Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0-M3
    • Fix Version/s: Scala 2.10.0-M3
    • Component/s: Compiler (Misc)
    • Labels:
      None

      Description

      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)
        [...]
      

        Attachments

          Activity

            People

            • Assignee:
              burmako Eugene Burmako
              Reporter:
              michelou Stephane Micheloud
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: