Skip to content

Case class extending Any crash (Ycheck:all) #5041

@sir-wabbit

Description

@sir-wabbit
// -Ycheck:all
case class i1()extends Any
checking AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala after phase frontend
checking AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala after phase sbt-deps
checking AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala after phase posttyper
exception while typing this.eq of class class dotty.tools.dotc.ast.Trees$Select # 699
exception while typing this.eq(x$0.asInstanceOf[Object]) of class class dotty.tools.dotc.ast.Trees$Apply # 703
exception while typing this.eq(x$0.asInstanceOf[Object]).|| of class class dotty.tools.dotc.ast.Trees$Select # 704
exception while typing this.eq(x$0.asInstanceOf[Object]).||(
  x$0 match 
    {
      case x$0 @ _: i1 @unchecked => true
      case _ => false
    }
) of class class dotty.tools.dotc.ast.Trees$Apply # 705
exception while typing override def equals(x$0: Any): Boolean = 
  this.eq(x$0.asInstanceOf[Object]).||(
    x$0 match 
      {
        case x$0 @ _: i1 @unchecked => true
        case _ => false
      }
  ) of class class dotty.tools.dotc.ast.Trees$DefDef # 709
exception while typing @scala.annotation.internal.SourceFile(
  "AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala"
) case class i1() extends Any() with _root_.scala.Product { 
  def copy(): i1 = new i1()
  override def hashCode(): Int = 1837737630
  override def equals(x$0: Any): Boolean = 
    this.eq(x$0.asInstanceOf[Object]).||(
      x$0 match 
        {
          case x$0 @ _: i1 @unchecked => true
          case _ => false
        }
    )
  override def toString(): String = scala.runtime.ScalaRunTime._toString(this)
  override def canEqual(that: Any): Boolean = that.isInstanceOf[i1 @unchecked]
  override def productArity: Int = 0
  override def productPrefix: String = "i1"
  override def productElement(n: Int): Any = 
    n match 
      {
        case _ => throw new IndexOutOfBoundsException(n.toString())
      }
} of class class dotty.tools.dotc.ast.Trees$TypeDef # 751
exception while typing package <empty> {
  @scala.annotation.internal.SourceFile(
    "AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala"
  ) case class i1() extends Any() with _root_.scala.Product { 
    def copy(): i1 = new i1()
    override def hashCode(): Int = 1837737630
    override def equals(x$0: Any): Boolean = 
      this.eq(x$0.asInstanceOf[Object]).||(
        x$0 match 
          {
            case x$0 @ _: i1 @unchecked => true
            case _ => false
          }
      )
    override def toString(): String = scala.runtime.ScalaRunTime._toString(this)
    override def canEqual(that: Any): Boolean = that.isInstanceOf[i1 @unchecked]
    override def productArity: Int = 0
    override def productPrefix: String = "i1"
    override def productElement(n: Int): Any = 
      n match 
        {
          case _ => throw new IndexOutOfBoundsException(n.toString())
        }
  }
  final lazy module val i1: i1 = new i1()
  @scala.annotation.internal.SourceFile(
    "AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala"
  ) final module class i1() extends Object() with Function0[i1] { 
    this: i1.type =>
   
    def apply(): i1 = new i1()
    def unapply(x$1: i1): Boolean = true
  }
  final lazy module val Test: Test = new Test()
  @scala.annotation.internal.SourceFile(
    "AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala"
  ) final module class Test() extends Object() { this: Test.type => 
    def test(): Boolean = i1.apply().equals(i1.apply())
  }
} of class class dotty.tools.dotc.ast.Trees$PackageDef # 766
*** error while checking AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala after phase posttyper ***
exception occurred while compiling AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: symbols differ for this.eq
was                 : method eq
alternatives by type:  of types 
qualifier type      : i1(i1.this)
tree type           : ((x$0: Object): Boolean)(i1.this.eq) of class class dotty.tools.dotc.core.Types$CachedTermRef
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:38)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedSelect(TreeChecker.scala:346)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:1799)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1868)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:112)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:282)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1900)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1912)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:270)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:1976)
	at dotty.tools.dotc.typer.Applications.realApply$1(Applications.scala:695)
	at dotty.tools.dotc.typer.Applications.typedApply(Applications.scala:794)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:1818)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:1869)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:112)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typedUnadapted(TreeChecker.scala:282)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1900)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:1912)
	at dotty.tools.dotc.transform.TreeChecker$Checker.typed(TreeChecker.scala:270)
	at dotty.tools.dotc.typer.ReTyper.typedSelect(ReTyper.scala:42)

AE-3b3b6b8b578c2152ae06a6647f65684de4d4605d

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