summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-05-25 02:17:13 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-05-25 02:17:13 +0800
commit50688a8001325308c30a8669783f1d0e379b463b (patch)
tree4206bb8792370a6c02f91bf32782cf9645a0b8c0 /test/type_inference/init.lua
parentdfab76e01eb592b0cd2625d71a1ef7a859a2aee1 (diff)
downloadlua-language-server-50688a8001325308c30a8669783f1d0e379b463b.zip
fix #1150
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 947b97b3..5f54cebf 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2323,3 +2323,29 @@ end
local <?z?> = f()
]]
+
+TEST 'number' [[
+for _ in _ do
+ ---@type number
+ local <?x?>
+end
+]]
+
+TEST 'unknown' [[
+for _ in _ do
+ ---@param x number
+ local <?x?>
+end
+]]
+
+TEST 'unknown' [[
+---@type number
+for <?x?> in _ do
+end
+]]
+
+TEST 'number' [[
+---@param x number
+for <?x?> in _ do
+end
+]]