Skip to content

Commit 3c1e15e

Browse files
committed
fixup checkIrrefutable logic
1 parent 798f3bf commit 3c1e15e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,11 @@ trait Checking {
814814
def check(pat: Tree, pt: Type): Boolean = (pt <:< pat.tpe) || fail(pat, pt)
815815

816816
def recur(pat: Tree, pt: Type): Boolean =
817-
!(sourceVersion.isAtLeast(`3.2`) && !sourceVersion.isMigrating) ||
818-
pt.hasAnnotation(defn.UncheckedAnnot) || {
817+
sourceVersion.ordinal < `3.2`.ordinal
818+
|| pt.hasAnnotation(defn.UncheckedAnnot)
819+
|| {
819820
patmatch.println(i"check irrefutable $pat: ${pat.tpe} against $pt")
820-
pat match {
821+
pat match
821822
case Bind(_, pat1) =>
822823
recur(pat1, pt)
823824
case UnApply(fn, _, pats) =>
@@ -835,7 +836,6 @@ trait Checking {
835836
case _ =>
836837
check(pat, pt)
837838
}
838-
}
839839

840840
recur(pat, pt)
841841
}

0 commit comments

Comments
 (0)