Skip to content

Crash during pickler phase in guntiso/mojoz #24100

@WojciechMazur

Description

@WojciechMazur

Based on the OpenCB failure in guntiso/mojoz - build logs

Compiler version

Last good release: 3.8.0-RC1-bin-20250822-658c8bd-NIGHTLY
First bad release: 3.8.0-RC1-bin-20250823-712d5bc-NIGHTLY

Minimized code

trait Type

type ColumnDef = ColumnDef_[Type]
case class ColumnDef_[+T](comments: String)

type TableDef = TableDef_[ColumnDef]
case class TableDef_[+C <: ColumnDef_[?]](cols: Seq[C])

abstract class DdlGenerator:
  def columnComments(t: TableDef) = t.cols.map(_ => "")

class CassandraDdlGenerator() extends DdlGenerator:
  override def columnComments(t: TableDef) = ???

Output (click arrow to expand)

error when pickling type (t : TableDef)
error when pickling type (t.cols : Seq[ColumnDef])
error when pickling tree this of class class dotty.tools.dotc.ast.Trees$This
error when pickling tree this.type of class class dotty.tools.dotc.ast.Trees$SingletonTypeTree
error when pickling tree this.type | f.type of class class dotty.tools.dotc.ast.Trees$AppliedTypeTree
error when pickling tree new _root_.scala.annotation.retains[this.type | f.type] of class class dotty.tools.dotc.ast.Trees$TypeApply
error when pickling tree new _root_.scala.annotation.retains[this.type | f.type]() of class class dotty.tools.dotc.ast.Trees$Apply
error when pickling type Seq[String]
error when pickling tree Seq[String] of class class dotty.tools.dotc.ast.Trees$TypeTree
error when pickling tree override def columnComments(t: TableDef): Seq[String] = ??? of class class dotty.tools.dotc.ast.Trees$DefDef
error when pickling tree () extends DdlGenerator() {
  override def columnComments(t: TableDef): Seq[String] = ???
} of class class dotty.tools.dotc.ast.Trees$Template
error when pickling tree @SourceFile("test.scala") class CassandraDdlGenerator() extends DdlGenerator() {
  override def columnComments(t: TableDef): Seq[String] = ???
} of class class dotty.tools.dotc.ast.Trees$TypeDef
error when pickling tree package <empty> {
  @SourceFile("test.scala") class CassandraDdlGenerator() extends DdlGenerator() {
    override def columnComments(t: TableDef): Seq[String] = ???
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef

  unhandled exception while running pickler on /Users/wmazur/projects/scala/community-build3/test.scala

  An unhandled exception was thrown in the compiler.
  Please file a crash report here:
  https://github.com/scala/scala3/issues/new/choose
  For non-enriched exceptions, compile with -Xno-enrich-error-messages.


     while compiling: /Users/wmazur/projects/scala/community-build3/test.scala
        during phase: pickler
                mode: Mode(ImplicitsEnabled)
     library version: version (unknown)
    compiler version: version 3.8.0-RC1-bin-20250928-b67fcf2-NIGHTLY-git-b67fcf2
            settings: -classpath /Users/wmazur/Library/Caches/Coursier/v1/https/repo.scala-lang.org/artifactory/maven-nightlies/org/scala-lang/scala3-library_3/3.8.0-RC1-bin-20250928-b67fcf2-NIGHTLY/scala3-library_3-3.8.0-RC1-bin-20250928-b67fcf2-NIGHTLY.jar:/Users/wmazur/Library/Caches/Coursier/v1/https/repo.scala-lang.org/artifactory/maven-nightlies/org/scala-lang/scala-library/3.8.0-RC1-bin-20250928-b67fcf2-NIGHTLY/scala-library-3.8.0-RC1-bin-20250928-b67fcf2-NIGHTLY.jar -d /Users/wmazur/projects/scala/community-build3/.scala-build/community-build3_9c559b1bd2-9d23cdd7be/classes/main -sourceroot /Users/wmazur/projects/scala/community-build3

Exception in thread "main" java.lang.AssertionError: assertion failed: orphan parameter reference: TermParamRef(t)
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:10)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:318)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:183)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleExternalRef$1(TreePickler.scala:224)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:245)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:183)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:454)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:726)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree$$anonfun$21(TreePickler.scala:741)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:741)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTpt(TreePickler.scala:352)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree$$anonfun$4(TreePickler.scala:534)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:534)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:519)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:286)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:183)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:717)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTpt(TreePickler.scala:352)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleDef(TreePickler.scala:382)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:663)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleStats$$anonfun$2(TreePickler.scala:423)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleStats(TreePickler.scala:423)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:699)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleDef(TreePickler.scala:381)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:665)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleStats$$anonfun$2(TreePickler.scala:423)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleStats(TreePickler.scala:423)
        at dotty.tools.dotc.core.tasty.TreePickler.pickleTree(TreePickler.scala:715)
        at dotty.tools.dotc.core.tasty.TreePickler.pickle$$anonfun$1(TreePickler.scala:947)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.tasty.TreePickler.pickle(TreePickler.scala:945)
        at dotty.tools.dotc.transform.Pickler.run$$anonfun$1$$anonfun$1(Pickler.scala:306)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.transform.Pickler.run$$anonfun$1(Pickler.scala:279)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.transform.Pickler.run(Pickler.scala:278)
        at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:386)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:327)
        at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:379)
        at dotty.tools.dotc.transform.Pickler.runPhase$1(Pickler.scala:392)
        at dotty.tools.dotc.transform.Pickler.runOn(Pickler.scala:398)
        at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:380)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1327)
        at dotty.tools.dotc.Run.runPhases$1(Run.scala:373)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$2(Run.scala:420)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1$$anonfun$adapted$1(Run.scala:420)
        at scala.Function0.apply$mcV$sp(Function0.scala:45)
        at dotty.tools.dotc.Run.showProgress(Run.scala:482)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:420)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:432)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:69)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:432)
        at dotty.tools.dotc.Run.compileSources(Run.scala:319)
        at dotty.tools.dotc.Run.compile(Run.scala:304)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:37)
        at dotty.tools.dotc.Driver.process(Driver.scala:201)
        at dotty.tools.dotc.Driver.process(Driver.scala:169)
        at dotty.tools.dotc.Driver.process(Driver.scala:181)
        at dotty.tools.dotc.Driver.main(Driver.scala:211)
        at dotty.tools.dotc.Main.main(Main.scala)
Compilation failed

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions