summaryrefslogtreecommitdiff
path: root/test/type_inference/init.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-02 21:26:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-02 21:26:24 +0800
commitfd340f0ce2258b405d5c549dabee500829a91402 (patch)
tree08a269daf63fdc99147793ebacd7ae09d7f6ede8 /test/type_inference/init.lua
parent9fe22ad2c924bc3f6fb8c73a3301ccfeddf72c9b (diff)
downloadlua-language-server-fd340f0ce2258b405d5c549dabee500829a91402.zip
resolve infer of `string|table`
Diffstat (limited to 'test/type_inference/init.lua')
-rw-r--r--test/type_inference/init.lua22
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')
+]]