Skip to content

Commit f3019c6

Browse files
committed
supports ---@return ...
1 parent 4774c8c commit f3019c6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

script/vm/node.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ function mt:isNullable()
136136
for _, c in ipairs(self) do
137137
if c.type == 'nil'
138138
or (c.type == 'global' and c.cate == 'type' and c.name == 'nil')
139-
or (c.type == 'global' and c.cate == 'type' and c.name == 'any') then
139+
or (c.type == 'global' and c.cate == 'type' and c.name == 'any')
140+
or (c.type == 'global' and c.cate == 'type' and c.name == '...') then
140141
return true
141142
end
142143
end

test/diagnostics/common.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,13 @@ function F()
17271727
end
17281728
]]
17291729

1730+
TEST [[
1731+
---@return ...
1732+
function F()
1733+
return
1734+
end
1735+
]]
1736+
17301737
do return end
17311738
TEST [[
17321739
---@return number

0 commit comments

Comments
 (0)