@@ -880,7 +880,7 @@ object SpaceEngine {
880880 case _ => tp
881881 })
882882
883- def checkExhaustivity (m : Match )(using Context ): Unit = if exhaustivityCheckable(m.selector) then trace(i " checkExhaustivity( $m) " , debug) {
883+ def checkExhaustivity (m : Match )(using Context ): Unit = trace(i " checkExhaustivity( $m) " , debug) {
884884 val selTyp = toUnderlying(m.selector.tpe).dealias
885885 debug.println(i " selTyp = $selTyp" )
886886
@@ -903,7 +903,7 @@ object SpaceEngine {
903903 report.warning(PatternMatchExhaustivity (showSpaces(deduped), m), m.selector)
904904 }
905905
906- private def redundancyCheckable (sel : Tree )(using Context ): Boolean =
906+ private def reachabilityCheckable (sel : Tree )(using Context ): Boolean =
907907 // Ignore Expr[T] and Type[T] for unreachability as a special case.
908908 // Quote patterns produce repeated calls to the same unapply method, but with different implicit parameters.
909909 // Since we assume that repeated calls to the same unapply method overlap
@@ -913,7 +913,7 @@ object SpaceEngine {
913913 && ! sel.tpe.widen.isRef(defn.QuotedExprClass )
914914 && ! sel.tpe.widen.isRef(defn.QuotedTypeClass )
915915
916- def checkRedundancy (m : Match )(using Context ): Unit = if redundancyCheckable(m.selector) then trace(i " checkRedundancy ( $m) " , debug) {
916+ def checkReachability (m : Match )(using Context ): Unit = trace(i " checkReachability ( $m) " , debug) {
917917 val cases = m.cases.toIndexedSeq
918918
919919 val selTyp = toUnderlying(m.selector.tpe).dealias
@@ -965,4 +965,8 @@ object SpaceEngine {
965965 i += 1
966966 }
967967 }
968+
969+ def checkMatch (m : Match )(using Context ): Unit =
970+ if exhaustivityCheckable(m.selector) then checkExhaustivity(m)
971+ if reachabilityCheckable(m.selector) then checkReachability(m)
968972}
0 commit comments