tl
tl copied to clipboard
Feature request: support usage before declaration for method
Giving:
local record mod
end
function mod:foo1()
self:foo2() -- error: invalid key 'foo2'
end
function mod:foo2()
end
It'd be nice that teal can support usage before declaration for method. Desired behavior: No error
I just thought I'd note that the following (explicitly declaring the method type before assigning the method itself) does work:
local record mod
foo2: function(self)
end
function mod:foo1()
self:foo2() -- no longer errors, as foo2 has been forward declared
end
function mod:foo2()
end