File tree Expand file tree Collapse file tree
test/library-tests/pattern-switch/cfg Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -471,6 +471,7 @@ private module ControlFlowGraphImpl {
471471 private SwitchCase getASuccessorSwitchCase ( PatternCase pred ) {
472472 result .getParent ( ) = pred .getParent ( ) and
473473 result .getIndex ( ) > pred .getIndex ( ) and
474+ // Note we do include `case null, default` (as well as plain old `default`) here.
474475 not result .( ConstCase ) .getValue ( _) instanceof NullLiteral and
475476 (
476477 result .getIndex ( ) <= getNextPatternCase ( pred ) .getIndex ( )
@@ -492,6 +493,8 @@ private module ControlFlowGraphImpl {
492493 (
493494 result .( ConstCase ) .getValue ( _) instanceof NullLiteral
494495 or
496+ result instanceof NullDefaultCase
497+ or
495498 not exists ( getPatternCase ( switch , _) )
496499 or
497500 result .getIndex ( ) <= getPatternCase ( switch , 0 ) .getIndex ( )
Original file line number Diff line number Diff line change 144144| Test.java:55:13:55:25 | (...)... | Test.java:56:8:56:21 | case ... |
145145| Test.java:55:13:55:25 | (...)... | Test.java:58:8:58:21 | case ... |
146146| Test.java:55:13:55:25 | (...)... | Test.java:61:8:61:42 | case T t ... |
147+ | Test.java:55:13:55:25 | (...)... | Test.java:69:8:69:26 | case null, default |
147148| Test.java:55:21:55:25 | thing | Test.java:55:13:55:25 | (...)... |
148149| Test.java:56:8:56:21 | case ... | Test.java:57:10:57:44 | <Expr>; |
149150| Test.java:57:10:57:19 | System.out | Test.java:57:29:57:42 | "It's Const1!" |
You can’t perform that action at this time.
0 commit comments