diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 15:36:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-15 15:36:03 +0800 |
commit | 96b4e0ba089c717aa5455a7f6fcf6caee863a74e (patch) | |
tree | e82bd7e57cf641d3e2a37892e7f5c892cab41bbf /test/type_inference/init.lua | |
parent | 98fe538e564bac10e5df65c31e20b8dc3317e87d (diff) | |
download | lua-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.lua | 11 |
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?>) +]] |