Minor annotation on the Object class

This commit is contained in:
2023-04-04 06:57:35 +02:00
parent 26c7ce091e
commit 8d2f3cef7f

View File

@@ -15,13 +15,18 @@
-- You should have received a copy of the GNU General Public License along with
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
local omi = select(2, ...)
---@class Object
local Object = omi.GetModule("types").Object
local IsDerivedFrom = omi.GetModule("types").IsDerivedFrom
-- Create a new instance of Object or (more likely) any inheriting class
function Object.new(class, ...)
---@generic T : Object
-- @param cls T
-- @return T
function Object.new(cls, ...)
local o = {}
setmetatable(o, class)
setmetatable(o, cls)
if o.Init ~= nil then
o:Init(...)