summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/emmy/manager.lua6
-rw-r--r--server/test/full/normal.lua5
2 files changed, 9 insertions, 2 deletions
diff --git a/server/src/emmy/manager.lua b/server/src/emmy/manager.lua
index fc7180bd..d7edbadb 100644
--- a/server/src/emmy/manager.lua
+++ b/server/src/emmy/manager.lua
@@ -100,9 +100,11 @@ function mt:addType(source)
for i, obj in ipairs(source) do
local typeUnit = newTypeUnit(self, obj)
local className = obj[1]
- local list = self:getClass(className)
+ if className then
+ local list = self:getClass(className)
+ list[source.id] = typeUnit
+ end
typeUnit:setParent(typeObj)
- list[source.id] = typeUnit
typeObj._childs[i] = typeUnit
obj:set('emmy.typeUnit', typeUnit)
end
diff --git a/server/test/full/normal.lua b/server/test/full/normal.lua
index facc0139..a673e74b 100644
--- a/server/test/full/normal.lua
+++ b/server/test/full/normal.lua
@@ -150,3 +150,8 @@ end
TEST [[
local x = ,
]]
+
+TEST [[
+---@type any|fun():nil
+local t
+]]