diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2023-03-13 19:21:40 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2023-03-13 19:21:40 +0800 |
commit | 6ef1608d857e0179c4db7a14037df84dbef676c8 (patch) | |
tree | b007e893750d513427db64f4eb04ece13c6ce787 /test | |
parent | 671d9526cbfa83c01e74aa3405f1d32b647822d7 (diff) | |
download | lua-language-server-6ef1608d857e0179c4db7a14037df84dbef676c8.zip |
look into unions for operators
fix #1996
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 15 |
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 +]] |