diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index 465f1636f3ed..cfbedf0dfc6a 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -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) => @@ -835,7 +836,6 @@ trait Checking { case _ => check(pat, pt) } - } recur(pat, pt) }