From 5e6160ab101bf7113546b0c13a9377b3f343b112 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 2 May 2022 19:20:41 +0200 Subject: [PATCH] Drop usage of ensureLambdaSub It doesn't seem to be needed anymore and as demonstrated in the commit message of a8641c5cbe6ad22707ea52c639ee894cfa09db57, it can lead to unnecessary checks. --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 2 +- tests/run-macros/tasty-simplified.check | 4 ++-- tests/run-staging/i5965.check | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index e1605c326a05..9bf9cd5f57c0 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -1008,7 +1008,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling otherArgs.take(d) ++ tl.paramRefs)) else otherTycon - (assumedTrue(tycon) || directionalIsSubType(tycon, adaptedTycon.ensureLambdaSub)) && + (assumedTrue(tycon) || directionalIsSubType(tycon, adaptedTycon)) && directionalRecur(adaptedTycon.appliedTo(args), other) } } diff --git a/tests/run-macros/tasty-simplified.check b/tests/run-macros/tasty-simplified.check index 41ae9120aa03..3afb7916ac63 100644 --- a/tests/run-macros/tasty-simplified.check +++ b/tests/run-macros/tasty-simplified.check @@ -1,4 +1,4 @@ -Functor[[A >: scala.Nothing <: scala.Any] => scala.collection.immutable.List[A]] +Functor[scala.collection.immutable.List] Unapply[[F >: scala.Nothing <: [_$9 >: scala.Nothing <: scala.Any] => scala.Any] => Functor[F], Wrap[scala.Int]] Unapply[[F >: scala.Nothing <: [_$9 >: scala.Nothing <: scala.Any] => scala.Any] => Functor[F], Wrap[Dummy]] -Functor[[A >: scala.Nothing <: scala.Any] => scala.Option[A]] +Functor[scala.Option] diff --git a/tests/run-staging/i5965.check b/tests/run-staging/i5965.check index 166c6cdff5c1..2eab9b0a2ba1 100644 --- a/tests/run-staging/i5965.check +++ b/tests/run-staging/i5965.check @@ -1,11 +1,11 @@ { - val y: [A >: scala.Nothing <: scala.Any] => scala.collection.immutable.List[A][scala.Int] = scala.List.apply[scala.Int](1, 2, 3) + val y: scala.collection.immutable.List[scala.Int] = scala.List.apply[scala.Int](1, 2, 3) (y: scala.collection.immutable.List[scala.Int]) } List(1, 2, 3) { - val y: [A >: scala.Nothing <: scala.Any] => scala.Option[A][scala.Int] = scala.Option.apply[scala.Int](4) + val y: scala.Option[scala.Int] = scala.Option.apply[scala.Int](4) (y: scala.Option[scala.Int]) }