The collision resolution mechanism in ImportUsed
is insufficient when importing > 2 packages with the same base name
#1637
Labels
bug
Something isn't working
The following test case triggers an unexpected result
Expected result
No errors / all tests pass.
Got
Yaegi Version
381e045
Additional Notes
I instrumented
ImportUsed
as follows:As the comment in the test notes, this is a "heisenbug" that depends on the map traversal order of
interp.binPkg
.If you have one "font" packages, there's no collision.
If you have two "font" packages, one is renamed to (for example)
github.com/user1/proj1_font/_.go
and the other togithub.com/user2/proj2_font/_.go
, and that's still fine.But if you have three, then the first two are renamed, and the third keeps its real name, thus shadowing the other two and hiding their symbols. Whether the test fails depends on whether
github.com/user3/proj3/font
loses the renaming fight.In the first two times through the loop in the sample output, it "wins", but "loses" on the third iteration.
The text was updated successfully, but these errors were encountered: