Skip to content

REPL crashes on raw type with AssertionError: unresolved symbols: type _ #10410

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mbloms opened this issue Nov 20, 2020 · 0 comments · Fixed by #12201
Closed

REPL crashes on raw type with AssertionError: unresolved symbols: type _ #10410

mbloms opened this issue Nov 20, 2020 · 0 comments · Fixed by #12201
Labels
Milestone

Comments

@mbloms
Copy link
Contributor

mbloms commented Nov 20, 2020

Minimized code

object Main:
  def toRaw[T](arr: Array[T]) = arr match {case arr: Array[?] => arr}
  def main(argv: Array[String]) = println(toRaw(argv))

Output (click arrow to expand)

This compiles fine and runs without issues:

$ scala3 Main This is fine
[Ljava.lang.String;@74650e52

However, calling toRaw from the REPL crashes:

$ scala3
Starting scala3 REPL...
scala> :l Main.scala
// defined object Main


scala> Main.toRaw(Array("Oh","no!"))
Exception in thread "main" java.lang.AssertionError: assertion failed: unresolved symbols: type _(line 1) when pickling rs$line$2
        at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
        at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:765)
        at dotty.tools.dotc.transform.Pickler.run$$anonfun$3$$anonfun$2(Pickler.scala:69)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.transform.Pickler.run$$anonfun$1(Pickler.scala:105)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.transform.Pickler.run(Pickler.scala:105)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:296)
        at scala.collection.immutable.List.map(List.scala:246)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:297)
        at dotty.tools.dotc.transform.Pickler.runOn(Pickler.scala:110)
        at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:185)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
        at dotty.tools.dotc.Run.runPhases$5(Run.scala:195)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:203)
        at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:210)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:152)
        at dotty.tools.repl.ReplCompiler.runCompilationUnit(ReplCompiler.scala:151)
        at dotty.tools.repl.ReplCompiler.compile(ReplCompiler.scala:161)
        at dotty.tools.repl.ReplDriver.compile(ReplDriver.scala:234)
        at dotty.tools.repl.ReplDriver.interpret(ReplDriver.scala:197)
        at dotty.tools.repl.ReplDriver.loop$1(ReplDriver.scala:130)
        at dotty.tools.repl.ReplDriver.runUntilQuit$$anonfun$1(ReplDriver.scala:133)
        at dotty.tools.repl.ReplDriver.withRedirectedOutput(ReplDriver.scala:152)
        at dotty.tools.repl.ReplDriver.runUntilQuit(ReplDriver.scala:133)
        at dotty.tools.repl.Main$.main(Main.scala:6)
        at dotty.tools.repl.Main.main(Main.scala)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants