-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compilation of Stdlib failed #9525
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
This is a walkaround for the following issue: scala/scala3#9525
Revert changes in e88c5b7
It looks like a bootstrap problem. What happens is: When JavaParser reads an annotation, it calls To fix, it, parsers should never look up symbols from definitions. Instead, they should produce untyped trees with the proper names. Object
|
Thanks for the tip @odersky . I'll try the solution and see how it works. |
Minimized code
Compile the following two files together (from stdlib) results in compiler crash:
volatile.scala:
VolatileByteRef.java
If we remove
volatile
keyword in the Java file, everything works fine.Output (click arrow to expand)
exception caught when loading class volatile: java.lang.AssertionError: assertion failed
exception occurred while typechecking community-build/community-projects/stdLib213/src/library/scala/runtime/VolatileByteRef.java
exception occurred while compiling community-build/community-projects/stdLib213/src/library/scala/runtime/VolatileByteRef.java, community-build/community-projects/stdLib213/src/library/scala/volatile.scala
java.lang.AssertionError: assertion failed while compiling community-build/community-projects/stdLib213/src/library/scala/runtime/VolatileByteRef.java, community-build/community-projects/stdLib213/src/library/scala/volatile.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
at dotty.tools.dotc.core.unpickleScala2.Scala2Unpickler.(Scala2Unpickler.scala:136)
at dotty.tools.dotc.core.classfile.ClassfileParser.unpickleScala$1(ClassfileParser.scala:781)
at dotty.tools.dotc.core.classfile.ClassfileParser.unpickleOrParseInnerClasses(ClassfileParser.scala:888)
at dotty.tools.dotc.core.classfile.ClassfileParser.parseClass(ClassfileParser.scala:165)
at dotty.tools.dotc.core.classfile.ClassfileParser.run(ClassfileParser.scala:90)
at dotty.tools.dotc.core.ClassfileLoader.load(SymbolLoaders.scala:407)
at dotty.tools.dotc.core.ClassfileLoader.doComplete(SymbolLoaders.scala:402)
at dotty.tools.dotc.core.SymbolLoader.complete(SymbolLoaders.scala:343)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:166)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeOnce(SymDenotations.scala:344)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.unforcedDecls(SymDenotations.scala:368)
at dotty.tools.dotc.core.SymDenotations$ClassDenotation.typeParamsFromDecls(SymDenotations.scala:1641)
at dotty.tools.dotc.core.SymDenotations$ClassDenotation.typeParams(SymDenotations.scala:1654)
at dotty.tools.dotc.core.TypeApplications$.typeParams$extension(TypeApplications.scala:160)
at dotty.tools.dotc.core.TypeApplications$.typeParamSymbols$extension(TypeApplications.scala:191)
at dotty.tools.dotc.typer.Typer.adaptType$1(Typer.scala:3487)
at dotty.tools.dotc.typer.Typer.adapt1(Typer.scala:3553)
at dotty.tools.dotc.typer.Typer.op$3(Typer.scala:2883)
at dotty.tools.dotc.typer.Typer.adapt(Typer.scala:2884)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2553)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2554)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2557)
at dotty.tools.dotc.typer.Namer.typedAheadType$$anonfun$1(Namer.scala:1223)
at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1215)
at dotty.tools.dotc.typer.Namer.typedAheadType(Namer.scala:1223)
at dotty.tools.dotc.typer.Namer.typedAheadAnnotationClass(Namer.scala:1238)
at dotty.tools.dotc.typer.Namer$Completer.addAnnotations$$anonfun$1(Namer.scala:725)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.typer.Namer$Completer.addAnnotations(Namer.scala:732)
at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:799)
at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:712)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:166)
at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:352)
at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2365)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2390)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2483)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2553)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2554)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2557)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2579)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2627)
at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2081)
at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2411)
at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2415)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2483)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2553)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2554)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2557)
at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2579)
at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2627)
at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2207)
at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2455)
at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2484)
at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2553)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2554)
at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2557)
at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2671)
at dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:78)
at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:83)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:84)
at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:119)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.immutable.List.foreach(List.scala:333)
at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:119)
at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:181)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
at dotty.tools.dotc.Run.runPhases$5(Run.scala:191)
at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:199)
at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:64)
at dotty.tools.dotc.Run.compileUnits(Run.scala:206)
at dotty.tools.dotc.Run.compileSources(Run.scala:143)
at dotty.tools.dotc.Run.compile(Run.scala:125)
at dotty.tools.dotc.Driver.doCompile(Driver.scala:38)
at dotty.tools.dotc.Driver.process(Driver.scala:195)
at dotty.tools.dotc.Driver.process(Driver.scala:164)
at dotty.tools.dotc.Driver.process(Driver.scala:176)
at dotty.tools.dotc.Driver.main(Driver.scala:203)
at dotty.tools.dotc.Main.main(Main.scala)
Initial diagnosis
The following commit is dubious e88c5b7. Reverting the change fixes the issue:
Need to dive deeper to the root cause.
The text was updated successfully, but these errors were encountered: