We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
case
1 parent af116ae commit e686bf8Copy full SHA for e686bf8
compiler/src/dotty/tools/dotc/ast/Desugar.scala
@@ -1365,13 +1365,10 @@ object desugar {
1365
}
1366
1367
def needsNoFilter(gen: GenFrom): Boolean =
1368
- if (gen.checkMode == GenCheckMode.FilterAlways) // pattern was prefixed by `case`
1369
- isIrrefutable(gen.pat, gen.expr)
1370
- else (
1371
- gen.checkMode != GenCheckMode.FilterNow ||
1372
- IdPattern.unapply(gen.pat).isDefined ||
1373
1374
- )
+ gen.checkMode == GenCheckMode.Ignore ||
+ gen.checkMode == GenCheckMode.Check ||
+ IdPattern.unapply(gen.pat).isDefined ||
+ isIrrefutable(gen.pat, gen.expr)
1375
1376
/** rhs.name with a pattern filter on rhs unless `pat` is irrefutable when
1377
* matched against `rhs`.
0 commit comments