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
import scala.reflect.mirror._
object Test extends App {
val toolbox = mkToolBox()
def printSource[T](expr: Expr[T]) {
val ttree = toolbox typeCheck expr.tree
println(ttree.toString)
}
var y = 3
printSource(reify {
5 + y
})
}
Compiler output:
scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxError: reflective typecheck has failed: object y is not a member of package Test
at scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxGlobal$$anonfun$typeCheckExpr$2.apply(ToolBoxes.scala:125)
at scala.reflect.runtime.ToolBoxes$ToolBox$ToolBoxGlobal$$anonfun$typeCheckExpr$2.apply(ToolBoxes.scala:106)
at scala.tools.nsc.typechecker.Contexts$Context.withMacrosEnabled(Contexts.scala:221)
[...]
The text was updated successfully, but these errors were encountered:
Compiler output:
The text was updated successfully, but these errors were encountered: