-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotc -Ytest-pickler fails on cyclic reference in valid Scala 2.12 code #3479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I could not reproduce it. It seems to work fine for me. |
Confirmed - it works for me on master as well. Closest commit I've tested where it still breaks is 253f505. |
@odersky @smarter reopen? The exception still happens if a package is added: package dotty.tools.dotc.transform.patmat
sealed trait TermConstraint {
final def neg: TermConstraint = this match {
case Neg(c) => c
case c: PositiveTermConstraint => Neg(c)
}
}
case class Neg(c: PositiveTermConstraint) extends TermConstraint
sealed trait PositiveTermConstraint extends TermConstraint
case object Dummy extends PositiveTermConstraint Exception
Note the stacktrace is slightly different this time. The file on which this occurs is this. I'll try to rewrite the code to not trigger this and see if an exception doesn't happen somewhere else on that branch. EDIT: tested on f16f71a. |
After testing, it appears that package dotty.tools
sealed trait TermConstraint
case class Neg(c: PositiveTermConstraint) extends TermConstraint
trait PositiveTermConstraint extends TermConstraint Removing anything will stop triggering the problem, including removing either package name. |
Inverting the last two definitions also solves the issue. |
I've been to apply the above workaround to #3454 after rebasing it, without any success. While inverting the definitions works for the minimal example, it doesn't work for the original file. For instance, on current master cc43c34, running package dotty.tools.dotc.transform.patmat
sealed trait TermConstraint
sealed trait PositiveTermConstraint extends TermConstraint
case class Neg(c: PositiveTermConstraint) extends TermConstraint
case object Dummy extends PositiveTermConstraint
case object AlwaysSatisfied extends PositiveTermConstraint emits the same error. This time, commenting out either Dummy or AlwaysSatisfied works, but commenting out Dummy (almost unused) in the real file doesn't. I've uploaded the rebased PR at AleksanderBG/dotty@04b6d5c7172b4b75e471c06aa092c3b885d99bfb - original file is |
This issue seems to be a duplicate of #1932 |
@allanrenucci That's actually very helpful, thanks! I just quickly checked and removing |
#1932 works OK for me now. Can someone check whether the issue here is also fixed? |
Work OK for me too on latest master. |
dotc -Ytest-pickler
fails on the following code:Compiler output
The text was updated successfully, but these errors were encountered: