File tree 1 file changed +14
-8
lines changed
src/dotty/tools/dotc/transform 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -339,9 +339,14 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
339
339
case List (_ : BodyTreeMaker ) =>
340
340
true
341
341
342
- // case x =>
343
- case List (_ : SubstOnlyTreeMaker , _ : BodyTreeMaker ) =>
344
- true
342
+ /* case x @ pat =>
343
+ * This includes:
344
+ * case x =>
345
+ * case x @ 5 =>
346
+ * case x @ (5 | 6) =>
347
+ */
348
+ case (_ : SubstOnlyTreeMaker ) :: rest =>
349
+ isSwitchCase(rest)
345
350
346
351
case _ =>
347
352
false
@@ -366,12 +371,13 @@ class PatternMatcher extends MiniPhaseTransform with DenotTransformer {thisTrans
366
371
case List (body : BodyTreeMaker ) =>
367
372
(Nil , body)
368
373
369
- // case x =>
370
- case List (subst : SubstOnlyTreeMaker , body : BodyTreeMaker ) =>
371
- /* Rebindings have been propagated, so `body` contains all the
372
- * necessary information. `subst` can be dropped at this point.
374
+ // case x @ pat =>
375
+ case (_ : SubstOnlyTreeMaker ) :: rest =>
376
+ /* Rebindings have been propagated, so the eventual body in `rest`
377
+ * contains all the necessary information. The substitution can be
378
+ * dropped at this point.
373
379
*/
374
- ( Nil , body )
380
+ extractSwitchCase(rest )
375
381
}
376
382
377
383
def doOverlap (a : List [Int ], b : List [Int ]): Boolean =
You can’t perform that action at this time.
0 commit comments