Skip to content
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

Runtime error with Scala reflection #5816

scabug opened this issue May 21, 2012 · 2 comments


Copy link

commented May 21, 2012

import scala.reflect.mirror._

object Test extends App {
  val toolbox = mkToolBox()

  def printSource[T](expr: Expr[T]) {
    val ttree = toolbox typeCheck expr.tree

  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)

This comment has been minimized.

Copy link

commented May 21, 2012

Imported From:
Reporter: @michelou
Affected Versions: 2.10.0-M3


This comment has been minimized.

Copy link

commented Jun 9, 2012

@xeno-by said:
Fixed in scala/scala@6bb5975

@scabug scabug closed this Jun 9, 2012

@scabug scabug added this to the 2.10.0-M3 milestone Apr 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.