Skip to content

Commit

Permalink
fixup checkIrrefutable logic
Browse files Browse the repository at this point in the history
  • Loading branch information
griggt committed Mar 6, 2022
1 parent 798f3bf commit 3c1e15e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions compiler/src/dotty/tools/dotc/typer/Checking.scala
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,11 @@ trait Checking {
def check(pat: Tree, pt: Type): Boolean = (pt <:< pat.tpe) || fail(pat, pt)

def recur(pat: Tree, pt: Type): Boolean =
!(sourceVersion.isAtLeast(`3.2`) && !sourceVersion.isMigrating) ||
pt.hasAnnotation(defn.UncheckedAnnot) || {
sourceVersion.ordinal < `3.2`.ordinal
|| pt.hasAnnotation(defn.UncheckedAnnot)
|| {
patmatch.println(i"check irrefutable $pat: ${pat.tpe} against $pt")
pat match {
pat match
case Bind(_, pat1) =>
recur(pat1, pt)
case UnApply(fn, _, pats) =>
Expand All @@ -835,7 +836,6 @@ trait Checking {
case _ =>
check(pat, pt)
}
}

recur(pat, pt)
}
Expand Down

0 comments on commit 3c1e15e

Please sign in to comment.