subclass's __instanceDict.__index should be a table if there is no custom __index

This commit is contained in:
Chao Yin 2019-10-18 18:49:15 +08:00
parent 6102f676c2
commit fd25b1a006

View File

@ -147,7 +147,9 @@ local DefaultMixin = {
local subclass = _createClass(name, self)
for methodName, f in pairs(self.__instanceDict) do
_propagateInstanceMethod(subclass, methodName, f)
if not (methodName == "__index" and type(f) == "table") then
_propagateInstanceMethod(subclass, methodName, f)
end
end
subclass.initialize = function(instance, ...) return self.initialize(instance, ...) end