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
Regression issue: compiler crashes with "java.lang.IllegalArgumentException: requirement failed: package parser" #10171
Comments
Imported From: https://issues.scala-lang.org/browse/SI-10171?orig=1
|
@retronym said: |
Tomer Gabel (holograph) said: (I apologize in advance if this response seems snippy or demanding. I highly respect and appreciate your work and responsiveness to this issue and others I've run into. I'm merely hoping that an analgesic is available for my more woeful users :-)) |
@retronym said:
It also compiles with the latest version of PR 5671:
Compiling with
I suspect the reference to the compiler internal class leaks into MacroHelper.class due a poor interaction of core/src/main/scala/com/tomergabel/accord/transform/ValidationTransform.scala: private val validatorType = typeOf[ Validator[_] ]
core/src/main/scala/com/tomergabel/accord/transform/ValidationTransform.scala: private val descriptorTerm = typeOf[ dsl.Descriptor[_] ].typeSymbol.name.toTermName
core/src/main/scala/com/tomergabel/accord/transform/ValidationTransform.scala: private val contextualizerTerm = typeOf[ dsl.Contextualizer[_] ].typeSymbol.name.toTermName
core/src/main/scala/com/tomergabel/accord/transform/ValidationTransform.scala: val vtype = TypeTree( appliedType( validatorType.typeConstructor, weakTypeOf[ T ] :: Nil ) ) with non existental types, such as |
@retronym said: protected def newUnitParser( code: String ): ast.parser.Parsers#UnitParser = {
val g: Global = context.asInstanceOf[ reflect.macros.runtime.Context ].global
g.newUnitParser( code, "<Accord>" )
} |
Tomer Gabel (holograph) said: Again thanks for your help! |
scala/scala#5671 as commented. Downstream ticket is also closed. |
I manage an open source library (Accord) that heavily uses macros, and have recently had reports that, when upgrading client code from 2.12.0 to 2.12.1, compilation breaks. I've managed to reproduce this with the attached sbt project (see below for sample output).
This is not merely a backwards compatibility issue, as it reproduces with a fresh local build of Accord with Scala 2.12.1. The reason I mentioned macros is that this issue seems quite similar to what Miles Sabin reported in [SI-9392], but his report never mentioned the initial "package parser" error and, if the ticket is accurate, a patch to make the compiler more lenient has made its way since before 2.12.0 went gold.
I'll be more than happy to help (contact me here, by e-mail at tomer@tomergabel.com, or through the project Gitter channel), but a quick glance at scala-reflect's
Types.scala
indicates that I'm completely out my depth here.Output looks like this on my end:
The text was updated successfully, but these errors were encountered: