From 3c1e15ecb347e774582bcb303226e7dd9f2a331d Mon Sep 17 00:00:00 2001 From: Tom Grigg Date: Sat, 5 Mar 2022 17:24:45 -0800 Subject: [PATCH] fixup checkIrrefutable logic --- compiler/src/dotty/tools/dotc/typer/Checking.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) }