summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-06-15 15:36:03 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-06-15 15:36:03 +0800
commit96b4e0ba089c717aa5455a7f6fcf6caee863a74e (patch)
treee82bd7e57cf641d3e2a37892e7f5c892cab41bbf /test/type_inference/init.lua
parent98fe538e564bac10e5df65c31e20b8dc3317e87d (diff)
downloadlua-language-server-96b4e0ba089c717aa5455a7f6fcf6caee863a74e.zip
resolve #1094 infer type by `error`
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 0a19082a..5ed572dd 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -2548,3 +2548,14 @@ while <?t?> ~= nil do
print(t)
end
]]
+
+TEST 'integer' [[
+---@type integer?
+local n
+
+if not n then
+ error('n is nil')
+end
+
+print(<?n?>)
+]]