You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can't try enteringPhase with phases that aren't in the current run.
The current crash is at Global#Run#resetPackageClass, which has the comment, "Reset package class to state at typer (not sure what this is needed for?)."
But I think even that fix assumes there are no phases between parser and namer, which ain't necessarily so. stopPhase means the stop-before is exactly that phase, but you could -Ystop-before:my-post-parser so that there is no namer.
So the useful idiom might be something like, enteringPhaseOrError or enteringPhaseMaybe, depending on whether it's OK to omit the work unit in this run. Rather than assert and crash.
apm@mara:~/tmp$ scalac -Ydebug-Ystop-after:namer trivial.scala
[running phase parser on trivial.scala]
[running phase namer on trivial.scala]
error:whilecompiling: trivial.scala
during phase: global=terminal, atPhase=namer
library version: version 2.10.1
compiler version: version 2.10.1
reconstructed args: -Ydebug-deprecation -feature -Ystop-after:namer
The text was updated successfully, but these errors were encountered:
apm@mara:~/tmp$ scalac -Ydebug-Xplugin:../projects/deprecator/checker.jar -Xshow-phases -Xgenerate-phase-graph phase-bug
phase name id description
-----------------------
parser 1 parse source into ASTs, perform simple desugaring
elide-deprecated 2
namer 3 resolve names, attach symbols to named trees
packageobjects 4 load packageobjects
typer 5 the meat and potatoes: typethe trees
check-deprecated 6
patmat 7 translate match expressions
superaccessors 8 add super accessors in traits and nested classes
then stop-after:parser fails
apm@mara:~/tmp$ scalac -Ydebug-Xplugin:../projects/deprecator/checker.jar -Ystop-after:parser trivial.scala [running phase parser on trivial.scala]
error: uncaught exception during compilation: java.lang.AssertionError
error: java.lang.AssertionError: assertion failed: <no phase>
at scala.reflect.internal.SymbolTable.phase_$eq(SymbolTable.scala:161)
You can't try enteringPhase with phases that aren't in the current run.
The current crash is at Global#Run#resetPackageClass, which has the comment, "Reset package class to state at typer (not sure what this is needed for?)."
A similar bug was fixed at
scala/scala@541a669
But I think even that fix assumes there are no phases between parser and namer, which ain't necessarily so. stopPhase means the stop-before is exactly that phase, but you could -Ystop-before:my-post-parser so that there is no namer.
So the useful idiom might be something like, enteringPhaseOrError or enteringPhaseMaybe, depending on whether it's OK to omit the work unit in this run. Rather than assert and crash.
The text was updated successfully, but these errors were encountered: