Skip to content

Compiler crashes on inner class that extends sealed class #3149

@allanrenucci

Description

@allanrenucci
sealed class Foo

class Test {
  def f = {
    class Bar extends Foo
  }
}
Stacktrace
exception occurred while compiling tests/allan/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: unresolved symbols: class Bar when pickling tests/allan/Test.scala
	at scala.Predef$.assert(Predef.scala:219)
	at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:592)
	at dotty.tools.dotc.transform.Pickler.$anonfun$run$3(Pickler.scala:52)
	at dotty.tools.dotc.transform.Pickler.$anonfun$run$3$adapted(Pickler.scala:45)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at dotty.tools.dotc.transform.Pickler.$anonfun$run$2(Pickler.scala:45)
	at dotty.tools.dotc.transform.Pickler.$anonfun$run$2$adapted(Pickler.scala:44)
	at scala.collection.immutable.List.foreach(List.scala:389)
	at dotty.tools.dotc.transform.Pickler.run(Pickler.scala:44)
	at dotty.tools.dotc.core.Phases$Phase.$anonfun$runOn$1(Phases.scala:288)
	at scala.collection.immutable.List.map(List.scala:283)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:286)
	at dotty.tools.dotc.core.Phases$Phase.runOn$(Phases.scala:285)
	at dotty.tools.dotc.transform.Pickler.runOn(Pickler.scala:76)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$3(Run.scala:124)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.trackTime(Stats.scala:47)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$2(Run.scala:122)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$2$adapted(Run.scala:120)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:191)
	at dotty.tools.dotc.Run.$anonfun$compileUnits$1(Run.scala:120)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:86)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:108)
	at dotty.tools.dotc.Run.compileSources(Run.scala:95)
	at dotty.tools.dotc.Run.compile(Run.scala:79)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:26)
	at dotty.tools.dotc.Driver.process(Driver.scala:124)
	at dotty.tools.dotc.Driver.process(Driver.scala:93)
	at dotty.tools.dotc.Driver.process(Driver.scala:105)
	at dotty.tools.dotc.Driver.main(Driver.scala:132)
	at dotty.tools.dotc.Main.main(Main.scala)
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
	at scala.sys.package$.error(package.scala:27)
  

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions