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
If you compile under 2.12 or 2.13, things are fine. But if you compile for 2.11, the macro does run and produces a tree, but the compiler crashes in a later phase:
[error] scala.reflect.internal.Types$TypeError: value <none> is not a member of scala.runtime.AbstractFunction0[org.sca
lacheck.Prop] with Serializable
[error] at scala.tools.nsc.typechecker.Contexts$ThrowingReporter.handleError(Contexts.scala:1402)
[error] at scala.tools.nsc.typechecker.Contexts$ContextReporter.issue(Contexts.scala:1254)
[error] at scala.tools.nsc.typechecker.Contexts$Context.issue(Contexts.scala:573)
[error] at scala.tools.nsc.typechecker.Typers$Typer.reportError$2(Typers.scala:4512)
[error] at scala.tools.nsc.typechecker.Typers$Typer.onError$3(Typers.scala:4556)
[error] at scala.tools.nsc.typechecker.Typers$Typer.normalTypedApply$1(Typers.scala:4581)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedApply$1(Typers.scala:4608)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typedInAnyMode$1(Typers.scala:5370)
[error] at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5387)
[error] at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5423)
[error] at scala.tools.nsc.typechecker.Typers$Typer.scala$tools$nsc$typechecker$Typers$Typer$$typedInternal(Typ
ers.scala:5450)
< stack trace continues for many lines >
However, these two very similar expressions both works fine under 2.11:
I spent some time trying to track this down. As far as I can tell it's a bug with quasiquoting, which we're using heavily to take trees apart and put them back together. The problem occurs when constructing the label, which can be as simple as q"($tree).toString" while still having problems.
It's possible we will be able to change the code so this works in 2.11, but I've exhausted my budget for looking into this. The current work-arounds are either to refactor your code as above, or just build a Prop directly without a label:
I noticed that certain kinds of expressions seem to cause problems under 2.11:
If you compile under 2.12 or 2.13, things are fine. But if you compile for 2.11, the macro does run and produces a tree, but the compiler crashes in a later phase:
However, these two very similar expressions both works fine under 2.11:
I spent some time trying to track this down. As far as I can tell it's a bug with quasiquoting, which we're using heavily to take trees apart and put them back together. The problem occurs when constructing the label, which can be as simple as
q"($tree).toString"
while still having problems.It's possible we will be able to change the code so this works in 2.11, but I've exhausted my budget for looking into this. The current work-arounds are either to refactor your code as above, or just build a
Prop
directly without a label:I'm planning to add a test to track this, to make it easy for me (or others) to pick this up later.
The text was updated successfully, but these errors were encountered: