Skip to content

AssertionError: NoDenotation.owner #3647

Closed
@sir-wabbit

Description

@sir-wabbit
object App {
  def main(args: Array[String]): Unit = {
    trait FooT {
      type T
      type Bar[A]

      def get(k: Bar[T]): String
    }
    val test: FooT = new FooT {
      type T = String
      type Bar[A] = J[A]
      sealed abstract class J[A]
      final case object JName extends J[T]
      final case object JInt extends J[Int]

      def get(k: J[T]): String = k match {
        case JName => "Age"
      }
    }
  }
}

kills the compiler with:

error when pickling type {...}.this.J
error when pickling type {...}.this.J[A]
error when pickling type {...}.this.J
error when pickling type  = {...}.this.J
error when pickling type FooT{T = String; Bar = {...}.this.J}
error when pickling type {z1 => FooT{T = String; Bar = z1.J}}
error when pickling tree {z1 => FooT{T = String; Bar = z1.J}}
error when pickling tree new Object with FooT{...}(): {z1 => FooT{T = String; Bar = z1.J}}
...
Exception in thread "main" java.lang.AssertionError: NoDenotation.owner
	at dotty.tools.dotc.core.SymDenotations$NoDenotation$.owner(SymDenotations.scala:1874)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.topLevel$1(SymDenotations.scala:928)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.topLevelClass(SymDenotations.scala:931)
	at dotty.tools.dotc.core.tasty.TreePickler.isLocallyDefined(TreePickler.scala:82)
	at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:191)
	at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:132)
	at dotty.tools.dotc.core.tasty.TreePickler.$anonfun$pickleNewType$1(TreePickler.scala:148)
	at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:32)
	at dotty.tools.dotc.core.tasty.TreePickler.pickleNewType(TreePickler.scala:148)
	at dotty.tools.dotc.core.tasty.TreePickler.pickleType(TreePickler.scala:132)
	at dotty.tools.dotc.core.tasty.TreePickler.$anonfun$pickleMethodic$1(TreePickler.scala:264)
	at dotty.tools.dotc.core.tasty.TreePickler.withLength(TreePickler.scala:32)
	at dotty.tools.dotc.core.tasty.TreePickler.pickleMethodic(TreePickler.scala:263)
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions