diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-12-02 21:26:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-12-02 21:26:24 +0800 |
commit | fd340f0ce2258b405d5c549dabee500829a91402 (patch) | |
tree | 08a269daf63fdc99147793ebacd7ae09d7f6ede8 /test | |
parent | 9fe22ad2c924bc3f6fb8c73a3301ccfeddf72c9b (diff) | |
download | lua-language-server-fd340f0ce2258b405d5c549dabee500829a91402.zip |
resolve infer of `string|table`
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index 84462da6..631c52b8 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -342,3 +342,25 @@ local function f() end local x = f() local <?y?> = x[1] ]] + +TEST 'table' [[ +local <?t?> +print(t.sub()) +]] + +TEST 'string|table' [[ +local <?t?> +print(t:sub()) +]] + +TEST 'string' [[ +local <?t?> +print(t:sub()) +print(t .. 'a') +]] + +TEST 'string' [[ +local <?t?> +print(#t) +print(t .. 'a') +]] |