diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-05-22 15:36:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-05-22 15:36:26 +0800 |
commit | 86916250304abc76b4b54486851f33ac12e64caf (patch) | |
tree | ed5a84ac6d19f4413172c61f0901653c0cefa82d /test/type_inference | |
parent | 3bf4d7d022335657f237ac6d059ab1ce29af2232 (diff) | |
download | lua-language-server-86916250304abc76b4b54486851f33ac12e64caf.zip |
special searching for `__index`
#2106
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 14 |
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?> +]] |