summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-12-16 16:40:20 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-12-16 16:40:20 +0800
commit5c17a569a3e722606385d6de98c0ddc7dfd9d007 (patch)
tree50c0eed010212852d22ac0b767cd05fcc57e7f20 /test/type_inference
parentabb5d1339f638e78bde32707261b2f255b64c9c1 (diff)
downloadlua-language-server-5c17a569a3e722606385d6de98c0ddc7dfd9d007.zip
fix
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 4479e031..0b69a34c 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4136,3 +4136,15 @@ end
print(<?x?>)
]]
+
+TEST 'number' [[
+---@type number[]
+local xs
+
+---@type fun(x): number?
+local f
+
+for _, <?x?> in ipairs(xs) do
+ x = f(x)
+end
+]]