From b9430cb927214b3302b44abcddb429827cc9b85e Mon Sep 17 00:00:00 2001 From: odersky Date: Thu, 28 Mar 2024 15:26:53 +0100 Subject: [PATCH] Update compiler/src/dotty/tools/dotc/core/TypeComparer.scala --- compiler/src/dotty/tools/dotc/core/TypeComparer.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala index 39e9fcea4e0f..159b2f01dbf4 100644 --- a/compiler/src/dotty/tools/dotc/core/TypeComparer.scala +++ b/compiler/src/dotty/tools/dotc/core/TypeComparer.scala @@ -2529,6 +2529,7 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling if isSuperOf(sub) then NoType else tp end dropIfSuper + /** If some (|-operand of) `tp` is a subtype of `sup` replace it with `NoType`. */ private def dropIfSub(tp: Type, sup: Type, canConstrain: Boolean): Type = def isSubOf(sup: Type): Boolean = sup match