We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c42eb3 commit d50b984Copy full SHA for d50b984
compiler/src/dotty/tools/dotc/transform/patmat/Space.scala
@@ -718,6 +718,11 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
718
}
719
720
private def redundancyCheckable(sel: Tree): Boolean =
721
+ // Ignore Expr for unreachability as a special case.
722
+ // Quote patterns produce repeated calls to the same unapply method, but with different implicit parameters.
723
+ // Since we assume that repeated calls to the same unapply method overlap
724
+ // and implicit parameters cannot normally differ between two patterns in one `match`,
725
+ // the easiest solution is just to ignore Expr.
726
!sel.tpe.hasAnnotation(defn.UncheckedAnnot) && !sel.tpe.widen.isRef(defn.QuotedExprClass)
727
728
def checkRedundancy(_match: Match): Unit = {
0 commit comments