diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-03-10 21:03:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-03-10 21:03:07 +0800 |
commit | 8a7c94965cf6c632b3b85956f0e64928df8dc42d (patch) | |
tree | d1fe2fba7af02d740acd0b83c8de46b0ea236fab /test | |
parent | 04601c7da4a485d84be5e0b9864acf27f978c275 (diff) | |
download | lua-language-server-8a7c94965cf6c632b3b85956f0e64928df8dc42d.zip |
update
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index dead9fab..07a3e2f0 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -52,6 +52,27 @@ TEST 'number' [[ local <?var?> = 1.0 ]] +TEST 'unknown' [[ +local <?var?> +]] + +TEST 'unknown' [[ +local <?var?> +var = y +]] + +TEST 'any' [[ +function f(<?x?>) + +end +]] + +TEST 'any' [[ +function f(<?x?>) + x = 1 +end +]] + TEST 'number' [[ local <?var?> var = 1 @@ -450,6 +471,16 @@ TEST 'fun()' [[ local <?x?> ]] +TEST 'fun(a: string, b: any, ...: any)' [[ +---@type fun(a: string, b, ...) +local <?x?> +]] + +TEST 'fun(a: string, b: any, c?: boolean, ...: any):c, d?, ...' [[ +---@type fun(a: string, b, c?: boolean, ...):c, d?, ... +local <?x?> +]] + TEST 'table<string, number>' [[ ---@class string ---@class number |