From 74a04423bb05ad5a7a906fe515e07417f60fb3ca Mon Sep 17 00:00:00 2001 From: Max Cahill <1bardesign@gmail.com> Date: Tue, 24 Mar 2020 14:57:42 +1100 Subject: [PATCH] [removed] class.lua dependency on table.overlay - fixed #1 --- class.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/class.lua b/class.lua index 2a92d4f..c39c552 100644 --- a/class.lua +++ b/class.lua @@ -19,8 +19,12 @@ local function class(inherits) --performing a super construction if necessary and assigning the right metatable function c:init(t, ...) if inherits then - --super ctor, then overlay args table - t = table.overlay(inherits:new(...), t) + --construct superclass instance, then overlay args table + local ct = inherits:new(...) + for k,v in pairs(t) do + ct[k] = v + end + t = ct end --upgrade to this class and return return setmetatable(t, self.__mt)