Skip to content

Infinite loop in subtyping check #318

Closed
@samuelgruetter

Description

@samuelgruetter

While looking for counterexamples to narrowing in DOT, I found this example:

object subtypcycle {
  trait Y {
    type A <: { type T >: B }
    type B >: { type T >: A }
  }

  val y: Y = ???
  val a: y.A = ???
  val b: y.B = a
}

Which sends dotty into an infinite loop checking if y.A <: y.B.

scalac has the same problem, see SI-9056.

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