Skip to content

Commit 94a45e8

Browse files
committed
support yanghuan#280
1 parent d9446e5 commit 94a45e8

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • CSharp.lua/CoreSystem.Lua/CoreSystem

‎CSharp.lua/CoreSystem.Lua/CoreSystem/Type.lua‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,19 @@ local types = {
306306
[Number] = newNumberType(Number),
307307
}
308308

309+
local customTypeof = System.config.customTypeof
310+
309311
function typeof(cls)
310312
assert(cls)
311313
local t = types[cls]
312314
if t == nil then
315+
if customTypeof then
316+
t = customTypeof(cls)
317+
if t then
318+
types[cls] = t
319+
return t
320+
end
321+
end
313322
t = setmetatable({ cls }, Type)
314323
types[cls] = t
315324
end

0 commit comments

Comments
 (0)