Skip to content

crash with assertion failed .. #1653

@helloqirun

Description

@helloqirun

$ cat abc.scala

trait Foo {
  def foo() = new Unit with Foo
}

$ dotc abc.scala

error while transforming () extends Unit() with Foo {}
error while transforming final class $anon() extends Unit() with Foo {}
error while transforming {
  final class $anon() extends Unit() with Foo {}
  new Unit with Foo{...}(): Unit & Foo
}
error while transforming def foo(): Unit & Foo =
  {
    final class $anon() extends Unit() with Foo {}
    new Unit with Foo{...}(): Unit & Foo
  }
error while transforming () extends Object {
  def foo(): Unit & Foo =
    {
      final class $anon() extends Unit() with Foo {}
      new Unit with Foo{...}(): Unit & Foo
    }
}
error while transforming @scala.annotation.internal.SourceFile("abc.scala") <trait> trait Foo() extends Object {
  def foo(): Unit & Foo =
    {
      final class $anon() extends Unit() with Foo {}
      new Unit with Foo{...}(): Unit & Foo
    }
}
error while transforming package <empty> {
  @scala.annotation.internal.SourceFile("abc.scala") <trait> trait Foo() extends Object {
    def foo(): Unit & Foo =
      {
        final class $anon() extends Unit() with Foo {}
        new Unit with Foo{...}(): Unit & Foo
      }
  }
}

exception occurred while compiling abc.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
	at scala.Predef$.assert(Predef.scala:151)
	at dotty.tools.dotc.transform.SyntheticMethods.dotty$tools$dotc$transform$SyntheticMethods$$valueHashCodeBody$1(SyntheticMethods.scala:141)
	at dotty.tools.dotc.transform.SyntheticMethods$$anonfun$syntheticRHS$1$1.apply(SyntheticMethods.scala:87)
	at dotty.tools.dotc.transform.SyntheticMethods$$anonfun$syntheticRHS$1$1.apply(SyntheticMethods.scala:87)
	at dotty.tools.dotc.ast.tpd$.polyDefDef(tpd.scala:203)
	at dotty.tools.dotc.ast.tpd$.DefDef(tpd.scala:173)
	at dotty.tools.dotc.transform.SyntheticMethods.syntheticDef$1(SyntheticMethods.scala:96)
	at dotty.tools.dotc.transform.SyntheticMethods.dotty$tools$dotc$transform$SyntheticMethods$$syntheticDefIfMissing$1(SyntheticMethods.scala:70)
	at dotty.tools.dotc.transform.SyntheticMethods$$anonfun$syntheticMethods$1.apply(SyntheticMethods.scala:190)
	at dotty.tools.dotc.transform.SyntheticMethods$$anonfun$syntheticMethods$1.apply(SyntheticMethods.scala:190)
	at scala.collection.immutable.List.flatMap(List.scala:327)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions