Consider:
trait U { type A }
object Test {
def foo(u: U)(as: List[Any]): u.A = ???
}
qbin/scalac -uniqid -Xprint:uncurry sandbox/test.scala | grep foo
def foo#7305(
u#12154: U#6993,
as#12155: List#11181[Any#3329]
): u#16626.A#7301 = ...
Uncurry's info transformer sometimes [1] uses clones for the parameter symbols. Those clones are visible in `
fooDefDef.symbol.info`. But the parameter ValDefs, and types in the RHS of the DefDef still refer to the original parameter symbols.
This is enough to trigger a crash in tail call elimination, see SI-6900.
One can turn a blind eye to the problem but emitting casts [2], but this seems to be a huge bug magnet, so I'd like to hear ideas for less hacky fix.
It also prompted me to question my change for SI-6443, in which I changed the tree transformer in Uncurry but left the info transformer unchanged. (Instead, I updated the symbol info in the tree transformer [3]).
Thoughts, comments, suggestions?
-jason
[1] if it can get away without cloning, it does, see `TypeMap#noChangeToSymbols`. In the code above, use of the type alias `scala.List` is enough to use clones.