Skip to content

Commit

Permalink
Streamline isConcrete a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
odersky committed Jul 2, 2024
1 parent ef74d39 commit a9ba7a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
18 changes: 2 additions & 16 deletions compiler/src/dotty/tools/dotc/core/MatchTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,10 @@ object MatchTypes:
true
case tp1: TermRef =>
!tp1.symbol.is(Param) && isConcrete(tp1.underlying)
case tp1: TermParamRef =>
case _: (ParamRef | MatchType) =>
false
case tp1: SingletonType =>
case tp1: TypeProxy =>
isConcrete(tp1.underlying)
case tp1: ExprType =>
isConcrete(tp1.underlying)
case tp1: AnnotatedType =>
isConcrete(tp1.parent)
case tp1: RefinedOrRecType =>
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
Expand Down
1 change: 1 addition & 0 deletions compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ object Types extends TypeUtils {
* | +- HKTypeLambda
* | +- MatchType
* | +- FlexibleType
* | +- LazyRef
* |
* +- GroundType -+- AndType
* +- OrType
Expand Down

0 comments on commit a9ba7a8

Please sign in to comment.