bug
bug copied to clipboard
Toolbox can't compile package declaration
Toolbox can't compile code if it has package declaration. Next code produces an AssertionError error:
import scala.tools.reflect.ToolBox
import scala.reflect.runtime.currentMirror
val tb = ToolBox(currentMirror).mkToolBox()
val parsed = tb.parse("package A { case class Test()}")
tb.compile(parsed)
Exception in thread "main" java.lang.AssertionError: assertion failed:
method wrapper
while compiling: <no file>
during phase: typer
library version: version 2.12.7
compiler version: version 2.12.7
reconstructed args:
last tree to typer: Block
tree position: <unknown>
symbol: null
call site: method wrapper in object __wrapper$1$b4949b3f7ed847808ed0a1e82d913044 in package __wrapper$1$b4949b3f7ed847808ed0a1e82d913044
I have the same issue. Currently I do not know how to dynamically compile a class into a package.
Is it going to be solved ? or it is abandoned ?
Nobody's working on it. I don't think anybody has even looked into what a fix would involve.