Skip to content

Commit e29c40f

Browse files
committed
revert add isBetween
1 parent dc5d1d7 commit e29c40f

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

compiler/src/dotty/tools/dotc/config/SourceVersion.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ enum SourceVersion:
1717

1818
def isAtLeast(v: SourceVersion) = stable.ordinal >= v.ordinal
1919

20-
def isBetween(low: SourceVersion, high: SourceVersion): Boolean =
21-
require(low.ordinal < high.ordinal)
22-
isAtLeast(low) && stable.ordinal <= high.ordinal
23-
2420
object SourceVersion extends Property.Key[SourceVersion]:
2521
def defaultSourceVersion = `3.2`
2622

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,8 +1620,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
16201620
case Some(checkMode) if !sel.tpe.hasAnnotation(defn.UncheckedAnnot) =>
16211621
val isPatDef = checkMode == desugar.MatchCheck.IrrefutablePatDef
16221622
if !checkIrrefutable(sel, pat, isPatDef)
1623+
&& sourceVersion.isAtLeast(`3.2`)
16231624
&& sourceVersion.isMigrating
1624-
&& sourceVersion.isBetween(`3.2`, `future`)
16251625
then
16261626
if isPatDef then uncheckedBrackets(tree.selector) match
16271627
case None =>

0 commit comments

Comments
 (0)