summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-05-22 15:36:26 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-05-22 15:36:26 +0800
commit86916250304abc76b4b54486851f33ac12e64caf (patch)
treeed5a84ac6d19f4413172c61f0901653c0cefa82d /test/type_inference
parent3bf4d7d022335657f237ac6d059ab1ce29af2232 (diff)
downloadlua-language-server-86916250304abc76b4b54486851f33ac12e64caf.zip
special searching for `__index`
#2106
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 12a8e2ab..6a8ba588 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4278,3 +4278,17 @@ local x ---@type Some
print(<?x?>)
]]
+
+TEST 'integer' [[
+---@class metatable : table
+---@field __index table
+
+---@param table table
+---@param metatable? metatable
+---@return table
+function setmetatable(table, metatable) end
+
+local m = setmetatable({},{ __index = { a = 1 } })
+
+m.<?a?>
+]]