From cb9fcd88ac63eed06a16fe9f85deac2fc29b17eb Mon Sep 17 00:00:00 2001 From: HarrisL2 Date: Mon, 28 Oct 2024 11:31:55 -0400 Subject: [PATCH] Add comment --- compiler/src/dotty/tools/dotc/transform/patmat/Space.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala index c7b304e6caf6..c7f7a236fcf3 100644 --- a/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala +++ b/compiler/src/dotty/tools/dotc/transform/patmat/Space.scala @@ -941,6 +941,7 @@ object SpaceEngine { val msg = if nullOnly then MatchCaseOnlyNullWarning() else MatchCaseUnreachable() report.warning(msg, pat.srcPos) + // in redundancy check, take guard as false in order to soundly approximate val newPrev = if guard.isEmpty then covered :: prevs else prevs recur(rest, newPrev, Nil)