From b19dffde4d85c33b5735edaf1ce050c1ddd0a77d Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Tue, 25 Feb 2025 09:48:32 +0100 Subject: [PATCH] Revert "Add type avoidance to inferred MT bound lubbing" This reverts commit 2f6e60d5819873763609943962360c2f85f338bb. --- compiler/src/dotty/tools/dotc/typer/Typer.scala | 2 +- tests/pos/i21256.scala | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 tests/pos/i21256.scala diff --git a/compiler/src/dotty/tools/dotc/typer/Typer.scala b/compiler/src/dotty/tools/dotc/typer/Typer.scala index 9b7e4fe36668..9c3750c68621 100644 --- a/compiler/src/dotty/tools/dotc/typer/Typer.scala +++ b/compiler/src/dotty/tools/dotc/typer/Typer.scala @@ -2665,7 +2665,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer val lub = cases1.foldLeft(defn.NothingType: Type): (acc, case1) => if !acc.exists then NoType else if case1.body.tpe.isProvisional then NoType - else acc | TypeOps.avoid(case1.body.tpe, case1.pat.bindTypeSymbols) + else acc | case1.body.tpe if lub.exists then if !lub.isAny then val msg = em"Match type upper bound inferred as $lub, where previously it was defaulted to Any" diff --git a/tests/pos/i21256.scala b/tests/pos/i21256.scala deleted file mode 100644 index e51484c73ef7..000000000000 --- a/tests/pos/i21256.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - type MTWithBind[X] = X match { - case List[t] => t - } -}