-
-
Notifications
You must be signed in to change notification settings - Fork 423
Expand file tree
/
Copy pathno-unknown-operations.lua
More file actions
80 lines (65 loc) · 757 Bytes
/
no-unknown-operations.lua
File metadata and controls
80 lines (65 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
TEST [[
local x = 5
<!x()!>
---@overload fun(): string
local x = 5
x()
---@class x
---@operator call(): string
local x = {}
x()
]]
TEST [[
---@type nil
local x
<!x()!>
---@overload fun(): string
local x
x()
---@class x
---@operator call(): string
local x
x()
]]
TEST [[
---@type unknown
local x
x()
]]
TEST [[
local function f()
end
f()
]]
TEST [[
<!(0)()!>
]]
TEST [[
<!("")()!>
]]
TEST [[
(function() end)()
]]
TEST [[
local _ = 1 + 2
local _ = <!"1" + "2"!>
]]
TEST [[
local _ = "a" .. "b"
---@class Vec2
---@type Vec2, Vec2
local a, b = {}, {}
local _ = <!a .. b!>
]]
TEST [[
---@type unknown
local a
local b = a + 2
]]
TEST [[
---@param name string
---@return string
local function greet(name)
return "Hello " .. <!name "!"!>
end
]]