Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

Commit 062e56c

Browse files
committed
Warn on non-exhaustive for-comprehension patterns
We assume patterns are exhaustive when desugaring with `-Zirrefutable-generator-patterns` but we should still emit a warning if we think they might not be.
1 parent 6302465 commit 062e56c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/reflect/scala/reflect/internal/TreeGen.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ abstract class TreeGen {
622622
body) setPos splitpos
623623
case None =>
624624
atPos(splitpos) {
625-
mkVisitor(List(CaseDef(pat, EmptyTree, body)), checkExhaustive = false)
625+
mkVisitor(List(CaseDef(pat, EmptyTree, body)), checkExhaustive = settings.ZirrefutableGeneratorPatterns)
626626
}
627627
}
628628
}

0 commit comments

Comments
 (0)