summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/parser/guide.lua5
-rw-r--r--test/type_inference/init.lua5
2 files changed, 10 insertions, 0 deletions
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index 5e4652b3..8c5f8c4c 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -1492,6 +1492,11 @@ function m.checkSameSimpleInValueOfSetMetaTable(status, func, start, pushQueue)
local mt = args[2]
if obj then
pushQueue(obj, start, true)
+ local newStatus = m.status(status)
+ m.searchRefs(newStatus, obj, 'def')
+ for _, def in ipairs(newStatus.results) do
+ pushQueue(def, start, true)
+ end
end
if mt then
m.checkSameSimpleInValueInMetaTable(status, mt, start, pushQueue)
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 631c52b8..3de5bd6e 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -364,3 +364,8 @@ local <?t?>
print(#t)
print(t .. 'a')
]]
+
+TEST 'table' [[
+local t = {}
+local <?v?> = setmetatable(t)
+]]