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
Welcome to Scala2.11.8 (JavaHotSpot(TM) 64-BitServerVM, Java1.8.0_77).
Type in expressions for evaluation. Ortry:help.
scala>:paste
// Entering paste mode (ctrl-D to finish)importscala.tools.reflect.ToolBoximportscala.reflect.runtime.universe._valcode= showCode(reify {
importscala.collection.immutable._HashMap(1->"x")
}.tree)
valtb= runtimeMirror(getClass.getClassLoader).mkToolBox()
tb.eval(tb.parse(code))
// Exiting paste mode, now interpreting.
scala.tools.reflect.ToolBoxError: reflective compilation has failed:
objectapply is not a member of packageHashMap
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.throwIfErrors(ToolBoxFactory.scala:316)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.wrapInPackageAndCompile(ToolBoxFactory.scala:198)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$ToolBoxGlobal.compile(ToolBoxFactory.scala:252)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$$anonfun$compile$2.apply(ToolBoxFactory.scala:429)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$$anonfun$compile$2.apply(ToolBoxFactory.scala:422)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.liftedTree2$1(ToolBoxFactory.scala:355)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl$withCompilerApi$.apply(ToolBoxFactory.scala:355)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.compile(ToolBoxFactory.scala:422)
at scala.tools.reflect.ToolBoxFactory$ToolBoxImpl.eval(ToolBoxFactory.scala:444)
... 37 elided
I expect the code generated by showCode could be parsed and evaluated. Unfortunately it does not.
The text was updated successfully, but these errors were encountered:
I expect the code generated by
showCode
could be parsed and evaluated. Unfortunately it does not.The text was updated successfully, but these errors were encountered: