diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-09-24 15:02:50 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-09-24 15:02:50 +0800 |
commit | 8870b6a8f8827c7eaa70f9663f754586aa2408fc (patch) | |
tree | 3532bbdc7f15c94532975b5ad556e3f233da1618 /test | |
parent | 05e9b84c2f9c0effbe5ae86c19fd390ba8067e17 (diff) | |
download | lua-language-server-8870b6a8f8827c7eaa70f9663f754586aa2408fc.zip |
resolve #639
Diffstat (limited to 'test')
-rw-r--r-- | test/hover/init.lua | 15 | ||||
-rw-r--r-- | test/type_inference/init.lua | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua index c16e466d..8058317d 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1699,3 +1699,18 @@ print(b.<?x?>) [[ field A.x: any ]] + +TEST [[ +---@class A +---@field x number +---@field y number + +---@type A<string, number> +local <?t?> +]] +[[ +local t: A<string, number> { + x: number, + y: number, +} +]] diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 286d47cb..23ebf54e 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -353,6 +353,13 @@ TEST 'table<string, number>' [[ local <?x?> ]] +TEST 'A<string, number>' [[ +---@class A + +---@type A<string, number> +local <?x?> +]] + TEST 'table' [[ self.<?t?>[#self.t+1] = {} ]] |