diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index a9ea81a7..357dd04b 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -1919,3 +1919,29 @@ local <?x?> = t[1] TEST 'unknown' [[ local <?x?> = y and z ]] + +TEST 'integer' [[ +---@type integer? +local x + +assert(x) + +print(<?x?>) +]] + +TEST 'integer' [[ +---@type integer? +local x + +assert(x ~= nil) + +print(<?x?>) +]] + +TEST 'integer' [[ +local x + +assert(x == 1) + +print(<?x?>) +]] |