-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotc, scalac and javac lead to java.lang.VerifyError #8101
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 have an immediate fix, but to be complete it seems like we'll need to replace all usages of setFlag/resetFlag/flags_= in the compiler by something which takes all future denotations into account, see smarter@d975d53 /cc @odersky |
Oops, the previous commit didn't work since it didn't set the flag on the current denotation, smarter@410adde should work. |
After having looked at all setFlags and resetFlags in transform it seems to me that Scala2PartiallyAugmented flag is the only problematic one. Problematic means: The flag is changed more than once on the same symbol, and the symbol survives a compilation run. The Scala2PartiallyAugmented is essentially a signal between two phases that work has to be done. I believe it's better not use a flag for that. |
Flags can't be used as non-monotonic signals between phases since denotations are phase-versioned and later denotations might exist already when the flag of an earlier denotation is set. Use a set of mixins instead.
Flags can't be used as non-monotonic signals between phases since denotations are phase-versioned and later denotations might exist already when the flag of an earlier denotation is set. Use another flag _Scala2xFullyAugmented_ to make changes monotonic.
I agree that not resetting a flag is better, but Scala2PartiallyAugmented is not the only problematic flag in general. For example, in Memoize we do: field.setFlag(Mutable) // Necessary for vals mixed in from Scala2 traits if for some reason at this point a later denotation already exists for |
minimized code
Foo.scala:
JavaFoo.java:
iss1.scala:
Compile the first two files with scalac and javac respectively:
Then compile and run the third file with the
*.class
files from the scalac and javac invocation on the classpath. From SBT:Runtime output
If you debug with -Xprint, at some point
Bar
has a bad constructor which calls super twice:expectation
Should run correctly.
The text was updated successfully, but these errors were encountered: