From 6e5dcab53a926cfaff7bc613ccee8669de96dc56 Mon Sep 17 00:00:00 2001 From: odersky Date: Tue, 2 Jul 2024 14:30:05 +0200 Subject: [PATCH] Streamline isConcrete a bit more --- .../src/dotty/tools/dotc/core/MatchTypes.scala | 16 ++-------------- compiler/src/dotty/tools/dotc/core/Types.scala | 1 + 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/compiler/src/dotty/tools/dotc/core/MatchTypes.scala b/compiler/src/dotty/tools/dotc/core/MatchTypes.scala index 61caceccd5d4..a3becea40886 100644 --- a/compiler/src/dotty/tools/dotc/core/MatchTypes.scala +++ b/compiler/src/dotty/tools/dotc/core/MatchTypes.scala @@ -34,24 +34,12 @@ object MatchTypes: true case tp1: TermRef => !tp1.symbol.is(Param) && isConcrete(tp1.underlying) - case tp1: TermParamRef => + case _: (ParamRef | MatchType) => false - case tp1: SingletonType => - isConcrete(tp1.underlying) - case tp1: ExprType => - isConcrete(tp1.underlying) - case tp1: AnnotatedType => - isConcrete(tp1.parent) - case tp1: RefinedOrRecType => + case tp1: TypeProxy => isConcrete(tp1.underlying) case tp1: AndOrType => isConcrete(tp1.tp1) && isConcrete(tp1.tp2) - case tp1: TypeVar => - isConcrete(tp1.underlying) - case tp1: LazyRef => - isConcrete(tp1.ref) - case tp1: FlexibleType => - isConcrete(tp1.hi) case _ => false end isConcrete diff --git a/compiler/src/dotty/tools/dotc/core/Types.scala b/compiler/src/dotty/tools/dotc/core/Types.scala index 6d84242648b2..f9588c5b97f5 100644 --- a/compiler/src/dotty/tools/dotc/core/Types.scala +++ b/compiler/src/dotty/tools/dotc/core/Types.scala @@ -76,6 +76,7 @@ object Types extends TypeUtils { * | +- HKTypeLambda * | +- MatchType * | +- FlexibleType + * | +- LazyRef * | * +- GroundType -+- AndType * +- OrType