diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 19:02:23 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-06 19:02:23 +0800 |
commit | 26e0310a410820650832f8576154c9b7ee183324 (patch) | |
tree | 3979fdaa48bdc223c2af9dd17b3f7a5f4764b8f6 /test | |
parent | 91ab8e7b4c3c17da0a1bcdfb02a38c23cc786910 (diff) | |
download | lua-language-server-26e0310a410820650832f8576154c9b7ee183324.zip |
support unary operator
Diffstat (limited to 'test')
-rw-r--r-- | test/type_inference/init.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua index bae14650..f31a8777 100644 --- a/test/type_inference/init.lua +++ b/test/type_inference/init.lua @@ -3391,3 +3391,30 @@ TEST 'unknown' [[ mt = {} mt.<?x?> = nil ]] + +TEST 'A' [[ +---@class A +---@operator unm: A + +---@type A +local a +local <?b?> = -a +]] + +TEST 'A' [[ +---@class A +---@operator bnot: A + +---@type A +local a +local <?b?> = ~a +]] + +TEST 'A' [[ +---@class A +---@operator len: A + +---@type A +local a +local <?b?> = #a +]] |