You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
local function bar()
end
local function foo()
if true then
return bar() -- ERROR: in return value: excess return values, expected 0 (), got 1 (())
else
bar()
return -- OK but not idiomatic
end
end
Note: with nil as explicit return, the checker is happy
local function bar(): nil
end
local function foo(): nil
return bar()
end
The text was updated successfully, but these errors were encountered:
Thanks for the report! This is definitely a bug that needs fixing.
return bar()
Is the goal here to trigger a tail call? It surprised me a bit which of the two options you marked as idiomatic — I usually never return f() from 0-ary functions, to help the reader spot that nothing is being returned.
Note: with
nil
as explicit return, the checker is happyThe text was updated successfully, but these errors were encountered: