summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-05-25 17:01:49 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-05-25 17:01:53 +0800
commit556be25be00f3ec346f27d13ebddf8bd99985ef2 (patch)
tree538723140adad06bfde33c8df36e8330c224e2eb /test/type_inference
parentadc1c1ba2f1039d36655f9042f0e16053115e88a (diff)
downloadlua-language-server-556be25be00f3ec346f27d13ebddf8bd99985ef2.zip
special treat `__*`
#2106
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 55b4f7af..8797cfdd 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4294,6 +4294,21 @@ m.<?a?>
]]
TEST 'integer' [[
+---@class metatable : table
+---@field __index table
+
+---@param table table
+---@param metatable? metatable
+---@return table
+function setmetatable(table, metatable) end
+
+local mt = {a = 1 }
+local m = setmetatable({},{ __index = mt })
+
+m.<?a?>
+]]
+
+TEST 'integer' [[
local x = 1
repeat
until <?x?>