diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 01:31:45 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-26 01:31:45 +0800 |
commit | c78fbf09aa4406db905a8a0e6dd5731871f2c262 (patch) | |
tree | 50d1c7005f1ab879608a5738d626370e1a01ac70 /test/type_inference | |
parent | ed64703ef9fec2b1c6736a0deb68bd567875a654 (diff) | |
download | lua-language-server-c78fbf09aa4406db905a8a0e6dd5731871f2c262.zip |
#1207
return names and parentheses can be used in `DocFunction`
Diffstat (limited to 'test/type_inference')
-rw-r--r-- | test/type_inference/init.lua | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index e86983b6..db5a38fd 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -510,12 +510,12 @@ TEST 'fun()' [[ local <?x?> ]] -TEST 'fun(a: string, b: any, ...: any)' [[ +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?, ...' [[ +TEST 'fun(a: string, b: any, c?: boolean, ...any):c, d?, ...' [[ ---@type fun(a: string, b, c?: boolean, ...):c, d?, ... local <?x?> ]] @@ -3092,3 +3092,37 @@ local function f() end local _, <?n?> = f() ]] + +TEST 'boolean' [[ +---@type fun():name1: boolean, name2:number +local f + +local <?n?> = f() +]] + +TEST 'number' [[ +---@type fun():name1: boolean, name2:number +local f + +local _, <?n?> = f() +]] +TEST 'boolean' [[ +---@type fun():(name1: boolean, name2:number) +local f + +local <?n?> = f() +]] + +TEST 'number' [[ +---@type fun():(name1: boolean, name2:number) +local f + +local _, <?n?> = f() +]] + +TEST 'boolean' [[ +---@type fun():...: boolean +local f + +local _, <?n?> = f() +]] |