Closed lewis6991 closed 1 year ago
@lewis6991 I couldn't reproduce the issue with the test case above. Could you double check the example? Thank you!
Ok, the issue was quite a bit more nuanced. Here's a minimal reproducer:
base.tl
:
local record M
foo: function(M)
end
return M
t1.tl
:
local B = require('base')
local M: B = {}
function M:foo()
end
return M
t2.tl
:
local B = require('base')
local M: B = {}
function M:foo()
end
return M
top.tl
:
local B = require('base')
local function new(cond: boolean): B
local C: B
if cond then
C = require('t1')
else
C = require('t2')
end
end
return new
Warning:
t2.tl:5:1: redeclaration of function 'foo'
@lewis6991 Thank you for the complete regression test! I pushed a fix.
Gives warnings:
Changing to
M.on_lines = function()...
works around the issue.