Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: Scala 2.10.0, Scala 2.11.0
    • Fix Version/s: Backlog
    • Component/s: Reflection
    • Labels:
      None

      Description

      import scala.reflect.runtime.universe._
      import scala.reflect.runtime.{currentMirror => cm}
      import scala.tools.reflect.ToolBox
       
      object Test extends App {
        val tb = cm.mkToolBox()
        val expr = tb.parse("math.sqrt(4.0)")
        println(tb.eval(expr))
      }
      

      C:\Projects\Kepler\sandbox @ ticket/5943>myke run .
      scala.tools.reflect.ToolBoxError: reflective compilation has failed:
       
      object sqrt is not a member of package math
              at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.throwIfErrors(ToolBoxFactory.scala:294)
              at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.compile(ToolBoxFactory.scala:227)
              at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.compile(ToolBoxFactory.scala:391)
              at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.eval(ToolBoxFactory.scala:394)
              at Test$delayedInit$body.apply(t5943b2.scala:8)
              at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
              at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
              at scala.App$$anonfun$main$1.apply(App.scala:61)
              at scala.App$$anonfun$main$1.apply(App.scala:61)
              at scala.collection.immutable.List.foreach(List.scala:309)
              at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
              at scala.collection.mutable.ListBuffer.foreach(ListBuffer.scala:45)
              at scala.App$class.main(App.scala:61)
              at Test$.main(t5943b2.scala:5)
              at Test.main(t5943b2.scala)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:71)
              at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
              at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:139)
              at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:71)
              at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:139)
              at scala.tools.nsc.CommonRunner$class.run(ObjectRunner.scala:28)
              at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:45)
              at scala.tools.nsc.CommonRunner$class.runAndCatch(ObjectRunner.scala:35)
              at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:45)
              at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
              at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:96)
              at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:105)
              at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                burmako Eugene Burmako
                Reporter:
                burmako Eugene Burmako
              • Votes:
                2 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated: