scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Toolbox can't compile package declaration #11195

Open alex-ivanov opened 6 years ago

alex-ivanov commented 6 years ago

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
MarkusLupusWolf commented 5 years ago

I have the same issue. Currently I do not know how to dynamically compile a class into a package.

pranjut commented 2 years ago

Is it going to be solved ? or it is abandoned ?

SethTisue commented 2 years ago

Nobody's working on it. I don't think anybody has even looked into what a fix would involve.