diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index e071fdf7..c76e372c 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -948,3 +948,47 @@ local x <?x?> = 1 ]] + +TEST 'any' [[ +---@return number +local function f(x) + local <?y?> = x() +end +]] + +TEST 'any' [[ +local mt + +---@return number +function mt:f() end + +local <?v?> = mt() +]] + +TEST 'any' [[ +local <?mt?> + +---@class X +function mt:f(x) end +]] + +TEST 'any' [[ +local mt + +---@class X +function mt:f(<?x?>) end +]] + +TEST 'any' [[ +local <?mt?> + +---@type number +function mt:f(x) end +]] + +TEST 'any' [[ +local mt + +---@type number +function mt:f(<?x?>) end +]] |