Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Scala 2.10.0-M3
    • Fix Version/s: Scala 2.10.0-M3
    • Component/s: Misc Compiler
    • 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)
        [...]
      

        Activity

        Show
        Eugene Burmako added a comment - Fixed in https://github.com/scala/scala/commit/6bb5975289c5b11cb8c88dd4629286956b5d3d27

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development