Open WojciechMazur opened 1 year ago
The error leading to an infinite loop was caused by the issue described in https://github.com/lampepfl/dotty/issues/16437 Even though this case leading to the infinite loop is already fixed, there seems to be a more general issue related to reporting errors.
I would not say this is about reporting errors but about preventing the compiler to get into illegal states. An underlying
that points to itself is illegal. We cannot check for cycles (too expensive) so the scheme is to prevent that in the first place. If the illegal state is caused by an erroneous program it's not enough to report the error we also have to prevent the illegal state internally.
When migrating one of Scala2 projects into Scala I ended up in infinite compilation loop. I was not yet able to minimize it, but I'm providing a thread dump of a compiler.
Compiler version
3.2.1
Minimized code
No minimization yet
Subsequent thread dump pointed to the same last method, so probably it's impossible to leave
dotty.tools.dotc.core.Types$ThisType.underlying(Types.scala:2938)
function callThread dump (click arrow to expand)