diff options
-rw-r--r-- | script/vm/runner.lua | 4 | ||||
-rw-r--r-- | test/type_inference/init.lua | 9 |
2 files changed, 13 insertions, 0 deletions
diff --git a/script/vm/runner.lua b/script/vm/runner.lua index b8ac13fd..8c1e816e 100644 --- a/script/vm/runner.lua +++ b/script/vm/runner.lua @@ -304,6 +304,10 @@ function mt:_lookInto(action, topNode, outNode) end elseif action.type == 'getindex' then self:_lookInto(action.index, topNode) + elseif action.type == 'table' then + for _, field in ipairs(action) do + self:_lookInto(field, topNode) + end end ::RETURN:: topNode = self:_fastWard(action.finish, topNode) diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 6d81e640..a8ea4cf3 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3175,3 +3175,12 @@ print(<?f?>) function f() end ]] + +TEST 'number' [[ +---@type number|nil +local n + +local t = { + x = n and <?n?>, +} +]] |