Skip to content

Commit ee18ae7

Browse files
committed
Revert support for t11603
- it's not a real use case and it's hard to imagine one - it does not work if the scrutinee and case are both singletons
1 parent e1e9f25 commit ee18ae7

File tree

3 files changed

+2
-8
lines changed

3 files changed

+2
-8
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,12 +1020,6 @@ object Types {
10201020
case _ => this
10211021
}
10221022

1023-
/** Widen singleton type modulo constant types */
1024-
final def widenNonConstant(implicit ctx: Context): Type = this match {
1025-
case _: ConstantType => this
1026-
case _ => widen
1027-
}
1028-
10291023
/** Widen type if it is unstable (i.e. an ExprType, or TermRef to unstable symbol */
10301024
final def widenIfUnstable(implicit ctx: Context): Type = stripTypeVar match {
10311025
case tp: ExprType => tp.resultType.widenIfUnstable

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
725725

726726
def checkExhaustivity(_match: Match): Unit = {
727727
val Match(sel, cases) = _match
728-
val selTyp = sel.tpe.widenNonConstant.dealias
728+
val selTyp = sel.tpe.widen.dealias
729729

730730
if (!exhaustivityCheckable(sel)) return
731731

@@ -756,7 +756,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
756756

757757
def checkRedundancy(_match: Match): Unit = {
758758
val Match(sel, cases) = _match
759-
val selTyp = sel.tpe.widenNonConstant.dealias
759+
val selTyp = sel.tpe.widen.dealias
760760

761761
if (!redundancyCheckable(sel)) return
762762

File renamed without changes.

0 commit comments

Comments
 (0)