summaryrefslogtreecommitdiff
path: root/test/type_inference
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-03-13 19:21:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-03-13 19:21:40 +0800
commit6ef1608d857e0179c4db7a14037df84dbef676c8 (patch)
treeb007e893750d513427db64f4eb04ece13c6ce787 /test/type_inference
parent671d9526cbfa83c01e74aa3405f1d32b647822d7 (diff)
downloadlua-language-server-6ef1608d857e0179c4db7a14037df84dbef676c8.zip
look into unions for operators
fix #1996
Diffstat (limited to 'test/type_inference')
-rw-r--r--test/type_inference/init.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index 66fa8768..bc70fbf4 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -4239,3 +4239,18 @@ TEST 'number' [[
local n
local <?v?> = n or error('')
]]
+
+TEST 'Foo' [[
+---@class Foo
+---@operator mul(Foo): Foo
+---@operator mul(Bar): Foo
+---@class Bar
+
+---@type Foo
+local foo
+
+---@type Foo|Bar
+local fooOrBar
+
+local <?b?> = foo * fooOrBar
+]]