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
double splice in macro fails when using -Yrangepos #6743
Comments
Imported From: https://issues.scala-lang.org/browse/SI-6743?orig=1
|
@cvogt said: |
@jrudolph said: A workaround is to set the position of the resulting tree of the macro to an arbitrary range position: val res = // original result of the macro
c.Expr[String](atPos(somePos)(res.tree)) |
@jrudolph said: Macros may generate both range positions and offset positions (this seems to be what reify does). The range position validator spews out this error if a tree with a range position is used inside a tree without a range position. |
@retronym said: |
@etorreborre said: However it returns the same kind of compiler error: "contains nonsynthetic tree", on the following code: snippet {
object AnInt { def unapply(a: String): Option[Int] = Some(a.toInt)}
def f: PartialFunction[String, Int] = { case AnInt(i) => i }
} |
@som-snytt said: The conversation continued on the ML months later: https://groups.google.com/d/msg/scala-internals/fmWKw5TDz98/SRXDDGPmzZEJ |
@xeno-by said: |
@xeno-by said: |
Reproduce code:
Reproduce steps:
scalac -Yrangepos Macros.scala
scalac -Yrangepos Test.scala
Expected result:
compiles
Actual Result:
The text was updated successfully, but these errors were encountered: