Skip to content

Commit 67bca18

Browse files
committed
test(diagnostics): add test suite for no-unknown-operations operator usage
1 parent 39105bb commit 67bca18

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/diagnostics/no-unknown-operations.lua

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,31 @@ TEST [[
5050
TEST [[
5151
(function() end)()
5252
]]
53+
54+
TEST [[
55+
local _ = 1 + 2
56+
local _ = <!"1" + "2"!>
57+
]]
58+
59+
TEST [[
60+
local _ = "a" .. "b"
61+
---@class Vec2
62+
63+
---@type Vec2, Vec2
64+
local a, b = {}, {}
65+
local _ = <!a .. b!>
66+
]]
67+
68+
TEST [[
69+
---@type unknown
70+
local a
71+
local b = a + 2
72+
]]
73+
74+
TEST [[
75+
---@param name string
76+
---@return string
77+
local function greet(name)
78+
return "Hello " .. <!name "!"!>
79+
end
80+
]]

0 commit comments

Comments
 (0)