teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.1k stars 108 forks source link

Returning a function call with no results from a function with no results should not cause an error #572

Closed catwell closed 1 year ago

catwell commented 1 year ago

This code:

local function foo()
end

local function bar()
    return foo()
end

bar()

fails with:

1 error:
mytest.tl:5:5: in in return value: excess return values, expected 0 (), got 1 (())

In my opinion it should be considered valid.

catwell commented 1 year ago

This was fixed by merging #567