Skip to content

Deep subtype failure when comparing types involving recursive references #14713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Linyxus opened this issue Mar 19, 2022 · 4 comments
Closed

Comments

@Linyxus
Copy link
Contributor

Linyxus commented Mar 19, 2022

Compiler version

3.1.2-RC2

Minimized code

The following code snippet will trigger the deep subtype assertion failure when -Yno-deep-subtypes is turned on.

trait FooBase {
  type This >: this.type <: FooBase { type This <: FooBase.this.This }
}

enum SUB[-A, +B]:
  case Refl[X]() extends SUB[X, X]

object Test {
  import SUB._
  def test(foo: FooBase) = {
    def f[A <: FooBase { type This <: foo.This }](e: SUB[FooBase { type This <: foo.This }, A]) = e match
      case Refl() =>
  }
}

I encountered this issue when I was trying to merge the path-dependent GADT support (previous PRs #13364, #13475) into the latest main branch. I found that my changes break the pos test i2941 by triggering a deep subtype failure. Then I managed to reproduce the problem without path-dependent GADTs.

In the above snippet, we are trying to narrow the lower bound of the type parameter A to FooBase { type This <: foo.This } by destructing the subtyping evidence e. During this, the GADT solver will try to check whether the new bounds are good (the subtyping relation between lower and upper bounds FooBase { type This <: foo.This } <: FooBase { type This <: foo.This } should hold), which is true by reflexivity but triggers the deep subtyping problem.

And I found that this problem may not be directly related to GADT reasoning. The following snippet causes deep subtyping failure too without involving GADTs.

  trait FooBase {
    type This >: this.type <: FooBase { type This <: FooBase.this.This }
  }

  object Test {
    def test(foo: FooBase) =
      val x: FooBase { type This <: foo.This } = ??? : FooBase { type This <: foo.This } // works
      val y: FooBase { type This <: foo.This } = ??? : foo.This  // crashes with deep subtype failure
  }

Output

[info] running (fork) dotty.tools.dotc.Main -classpath /Users/linyxus/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.8/scala-library-2.13.8.jar:/Users/linyxus/Workspace/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.1.3-RC1-bin-SNAPSHOT-nonbootstrapped/scala3-library_3-3.1.3-RC1-bin-SNAPSHOT.jar -color:never -Yno-deep-subtypes issues/i2941-gadt.scala
assertion failure for FooBase <:< Nothing, frozen = true
assertion failure for FooBase{This <: foo.This} <:< Nothing, frozen = true
assertion failure for foo.This <:< Nothing, frozen = true
assertion failure for FooBase{This <: foo.This#This} & foo.This <:< Nothing, frozen = true
assertion failure for FooBase{This <: foo.This#This} & foo.This <:< Nothing | Nothing, frozen = true
assertion failure for FooBase{This <: foo.This#This} & foo.This <:< foo.This#This, frozen = true
assertion failure for FooBase{This <: foo.This#This} & foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ >: Nothing | Nothing <: FooBase{This <: foo.This#This} & foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: A#This}, frozen = true
assertion failure for A <:< FooBase{This <: foo.This}, frozen = false
exception occurred while typechecking issues/i2941-gadt.scala
exception occurred while compiling issues/i2941-gadt.scala
java.lang.AssertionError: assertion failed while compiling issues/i2941-gadt.scala
Exception in thread "main" java.lang.AssertionError: assertion failed
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11)
	at dotty.tools.dotc.core.TypeComparer.monitoredIsSubType$1(TypeComparer.scala:228)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isNewSubType$1(TypeComparer.scala:1290)
	at dotty.tools.dotc.core.TypeComparer.fourthTry$1(TypeComparer.scala:804)
	at dotty.tools.dotc.core.TypeComparer.tryBaseType$1(TypeComparer.scala:754)
	at dotty.tools.dotc.core.TypeComparer.thirdTryNamed$1(TypeComparer.scala:526)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:561)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.fourthTry$1(TypeComparer.scala:767)
	at dotty.tools.dotc.core.TypeComparer.tryBaseType$1(TypeComparer.scala:754)
	at dotty.tools.dotc.core.TypeComparer.thirdTryNamed$1(TypeComparer.scala:526)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:299)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.fourthTry$1$$anonfun$2(TypeComparer.scala:841)
	at scala.Function0.apply$mcZ$sp(Function0.scala:39)
	at dotty.tools.dotc.core.TypeComparer.sufficientEither(TypeComparer.scala:1640)
	at dotty.tools.dotc.core.TypeComparer.either(TypeComparer.scala:1601)
	at dotty.tools.dotc.core.TypeComparer.fourthTry$1(TypeComparer.scala:841)
	at dotty.tools.dotc.core.TypeComparer.tryBaseType$1(TypeComparer.scala:754)
	at dotty.tools.dotc.core.TypeComparer.thirdTryNamed$1(TypeComparer.scala:526)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:561)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:445)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:351)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubApproxHi$1(TypeComparer.scala:1293)
	at dotty.tools.dotc.core.TypeComparer.thirdTryNamed$1(TypeComparer.scala:512)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:561)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:445)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.nonPrivateMember(Types.scala:656)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2289)
	at dotty.tools.dotc.core.Types$NamedType.memberDenot(Types.scala:2276)
	at dotty.tools.dotc.core.Types$NamedType.fromDesignator$1(Types.scala:2240)
	at dotty.tools.dotc.core.Types$NamedType.computeDenot(Types.scala:2254)
	at dotty.tools.dotc.core.Types$NamedType.denot(Types.scala:2211)
	at dotty.tools.dotc.core.Types$NamedType.info(Types.scala:2199)
	at dotty.tools.dotc.core.Types$Type.isRef(Types.scala:189)
	at dotty.tools.dotc.core.Types$Type.isFromJavaObject(Types.scala:300)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:304)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.compareNamed$1(TypeComparer.scala:301)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:307)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:321)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.compareTypeBounds$1(TypeComparer.scala:724)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:730)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:492)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSubInfo$1(TypeComparer.scala:1831)
	at dotty.tools.dotc.core.TypeComparer.qualifies$1(TypeComparer.scala:1834)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1839)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.member(Types.scala:650)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1838)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:440)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.member(Types.scala:650)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1838)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.isSub(TypeComparer.scala:201)
	at dotty.tools.dotc.core.ConstraintHandling.op$proxy2$1(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen(ConstraintHandling.scala:405)
	at dotty.tools.dotc.core.ConstraintHandling.isSubTypeWhenFrozen$(ConstraintHandling.scala:27)
	at dotty.tools.dotc.core.TypeComparer.isSubTypeWhenFrozen(TypeComparer.scala:30)
	at dotty.tools.dotc.core.TypeComparer$.isSubTypeWhenFrozen(TypeComparer.scala:2739)
	at dotty.tools.dotc.core.Types$Type.frozen_$less$colon$less(Types.scala:1044)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5083)
	at dotty.tools.dotc.core.Types$TypeBounds.$amp(Types.scala:5093)
	at dotty.tools.dotc.core.Types$Type.recoverable_$amp(Types.scala:1162)
	at dotty.tools.dotc.core.Types$Type.goRefined$1(Types.scala:784)
	at dotty.tools.dotc.core.Types$Type.go$1(Types.scala:702)
	at dotty.tools.dotc.core.Types$Type.findMember(Types.scala:876)
	at dotty.tools.dotc.core.Types$Type.memberBasedOnFlags(Types.scala:666)
	at dotty.tools.dotc.core.Types$Type.member(Types.scala:650)
	at dotty.tools.dotc.core.TypeComparer.hasMatchingMember(TypeComparer.scala:1838)
	at dotty.tools.dotc.core.TypeComparer.compareRefinedSlow$1(TypeComparer.scala:568)
	at dotty.tools.dotc.core.TypeComparer.compareRefined$1(TypeComparer.scala:589)
	at dotty.tools.dotc.core.TypeComparer.thirdTry$1(TypeComparer.scala:594)
	at dotty.tools.dotc.core.TypeComparer.secondTry$1(TypeComparer.scala:390)
	at dotty.tools.dotc.core.TypeComparer.firstTry$1(TypeComparer.scala:378)
	at dotty.tools.dotc.core.TypeComparer.recur(TypeComparer.scala:1318)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:189)
	at dotty.tools.dotc.core.TypeComparer.isSubType(TypeComparer.scala:199)
	at dotty.tools.dotc.core.TypeComparer.topLevelSubType(TypeComparer.scala:126)
	at dotty.tools.dotc.core.TypeComparer$.topLevelSubType(TypeComparer.scala:2727)
	at dotty.tools.dotc.core.Types$Type.$less$colon$less(Types.scala:1038)
	at dotty.tools.dotc.typer.Inferencing$.maximizeType$$anonfun$1(Inferencing.scala:412)
	at scala.runtime.function.JProcedure2.apply(JProcedure2.java:15)
	at scala.runtime.function.JProcedure2.apply(JProcedure2.java:10)
	at dotty.tools.dotc.util.SimpleIdentityMap$Map1.foreachBinding(SimpleIdentityMap.scala:62)
	at dotty.tools.dotc.typer.Inferencing$.maximizeType(Inferencing.scala:421)
	at dotty.tools.dotc.typer.Applications.typedUnApply(Applications.scala:1346)
	at dotty.tools.dotc.typer.Applications.typedUnApply$(Applications.scala:327)
	at dotty.tools.dotc.typer.Typer.typedUnApply(Typer.scala:117)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2832)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2895)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.typedPattern(Typer.scala:3100)
	at dotty.tools.dotc.typer.Typer.typedCase(Typer.scala:1715)
	at dotty.tools.dotc.typer.Typer.typedCases$$anonfun$1(Typer.scala:1648)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.loop$1(Decorators.scala:89)
	at dotty.tools.dotc.core.Decorators$ListDecorator$.mapconserve$extension(Decorators.scala:105)
	at dotty.tools.dotc.typer.Typer.typedCases(Typer.scala:1650)
	at dotty.tools.dotc.typer.Typer.$anonfun$26(Typer.scala:1640)
	at dotty.tools.dotc.typer.Applications.harmonic(Applications.scala:2195)
	at dotty.tools.dotc.typer.Applications.harmonic$(Applications.scala:327)
	at dotty.tools.dotc.typer.Typer.harmonic(Typer.scala:117)
	at dotty.tools.dotc.typer.Typer.typedMatchFinish(Typer.scala:1640)
	at dotty.tools.dotc.typer.Typer.typedMatch(Typer.scala:1596)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2846)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2895)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3080)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1471)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1461)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1471)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1708)
	at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:248)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1708)
	at dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1716)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1734)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1735)
	at dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1746)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1510)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1517)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1586)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:781)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:912)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:804)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:187)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:189)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2773)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2798)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2894)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2986)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3036)
	at dotty.tools.dotc.typer.Typer.typedBlockStats(Typer.scala:1067)
	at dotty.tools.dotc.typer.Typer.typedBlock(Typer.scala:1071)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2840)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2895)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3080)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr$$anonfun$1(Namer.scala:1471)
	at dotty.tools.dotc.typer.Namer.typedAhead(Namer.scala:1461)
	at dotty.tools.dotc.typer.Namer.typedAheadExpr(Namer.scala:1471)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1$$anonfun$1(Namer.scala:1708)
	at dotty.tools.dotc.typer.PrepareInlineable$.dropInlineIfError(PrepareInlineable.scala:248)
	at dotty.tools.dotc.typer.Namer.typedAheadRhs$1(Namer.scala:1708)
	at dotty.tools.dotc.typer.Namer.rhsType$1(Namer.scala:1716)
	at dotty.tools.dotc.typer.Namer.cookedRhsType$1(Namer.scala:1734)
	at dotty.tools.dotc.typer.Namer.lhsType$1(Namer.scala:1735)
	at dotty.tools.dotc.typer.Namer.inferredResultType(Namer.scala:1746)
	at dotty.tools.dotc.typer.Namer.inferredType$1(Namer.scala:1510)
	at dotty.tools.dotc.typer.Namer.valOrDefDefSig(Namer.scala:1517)
	at dotty.tools.dotc.typer.Namer.defDefSig(Namer.scala:1586)
	at dotty.tools.dotc.typer.Namer$Completer.typeSig(Namer.scala:781)
	at dotty.tools.dotc.typer.Namer$Completer.completeInCreationContext(Namer.scala:912)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:804)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:187)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:189)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2773)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2798)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2894)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2986)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3036)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2476)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$1(Typer.scala:2820)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2824)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2894)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2986)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:3036)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2603)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2865)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2895)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3080)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:43)
	at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:414)
	at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:50)
	at dotty.tools.dotc.typer.TyperPhase.runOn$$anonfun$3(TyperPhase.scala:84)
	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:333)
	at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:84)
	at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:225)
	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:1328)
	at dotty.tools.dotc.Run.runPhases$1(Run.scala:236)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:244)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:253)
	at dotty.tools.dotc.Run.compileSources(Run.scala:186)
	at dotty.tools.dotc.Run.compile(Run.scala:170)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
	at dotty.tools.dotc.Driver.process(Driver.scala:195)
	at dotty.tools.dotc.Driver.process(Driver.scala:163)
	at dotty.tools.dotc.Driver.process(Driver.scala:175)
	at dotty.tools.dotc.Driver.main(Driver.scala:205)
	at dotty.tools.dotc.Main.main(Main.scala)
[error] Nonzero exit code returned from runner: 1
[error] (scala3-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 3 s, completed Mar 19, 2022, 9:29:56 PM

Expectation

The code snippet should not trigger the deep subtype assertion.

@Linyxus Linyxus added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label area:typer labels Mar 19, 2022
@odersky
Copy link
Contributor

odersky commented Mar 19, 2022

The code snippet should not trigger the deep subtype assertion.

Why not? This looks exactly like the kind of recursive program that can trigger a deep subtype assertion. Note that there's nothing wrong with deep subtypes, the -Yno-deep-subtypes is just a plausibility check that they don't pop up where we do not expect them.

@odersky odersky added stat:needs info and removed itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 19, 2022
@odersky
Copy link
Contributor

odersky commented Mar 19, 2022

Here's the bottom recursions of the deep subtype check (to be read from bottom to top)

assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for foo.This <:< foo.This#This, frozen = true
assertion failure for type bounds [ <: foo.This] <:< type bounds [ <: foo.This#This], frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This#This}, frozen = true
assertion failure for foo.This <:< FooBase{This <: foo.This}, frozen = false

To classify this as a bug we'd have to argue that some of these steps should not be taken.

@Linyxus
Copy link
Contributor Author

Linyxus commented Mar 19, 2022

I found that I wrongly understood the meaning of deep subtype before. I thought that if a deep subtype failure happens then there would be infinite loops in type comparison. But after taking a deeper look into the code I figure out that it checks whether the recursion level exceeds a threshold (if so, either start monitoring or issue a failure), which may be a sign of infinite loops, but does not necessarily mean something bad happens.

Back to the issue here. I found that after turning off the -Yno-deep-subtypes the two code snippets compile on the main branch. But, on my branch (with path-dependent GADT reasoning enabled), the pos test i2941 enters an infinite loop. Therefore what I should really do is to check why the type comparison loops infinitely on my branch.

Sorry for the misunderstanding and thanks a lot for checking this!

@odersky
Copy link
Contributor

odersky commented Mar 19, 2022

No problem! So i think we can close the issue now.

@odersky odersky closed this as completed Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants