diff options
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 8ae65e48..0eb43ed3 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -1637,7 +1637,7 @@ function A() end ]] -TEST 'unknown' [[ +TEST 'string' [[ local x function A() @@ -2317,7 +2317,7 @@ local x print(<?x?>) ]] -TEST 'unknown?' [[ +TEST 'nil' [[ ---@type string? local x @@ -2391,7 +2391,7 @@ end print(<?t?>) ]] -TEST 'unknown?' [[ +TEST 'nil' [[ ---@type integer? local t @@ -3200,7 +3200,7 @@ local function f() end local x, y, <?z?> = 1, 2, f() ]] -TEST 'function' [[ +TEST 'unknown' [[ local f print(<?f?>) @@ -3208,6 +3208,26 @@ print(<?f?>) function f() end ]] +TEST 'unknown' [[ +local f + +do + print(<?f?>) +end + +function f() end +]] + +TEST 'function' [[ +local f + +function A() + print(<?f?>) +end + +function f() end +]] + TEST 'number' [[ ---@type number|nil local n |