File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
test/library-tests/guards12 Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -871,7 +871,13 @@ private module ControlFlowGraphImpl {
871
871
)
872
872
or
873
873
// the last node in a case rule is the last node in the right-hand side
874
- last ( n .( SwitchCase ) .getRuleStatement ( ) , last , completion )
874
+ // if the rhs is a statement we wrap the completion as a break
875
+ exists ( Completion caseCompletion |
876
+ last ( n .( SwitchCase ) .getRuleStatement ( ) , last , caseCompletion ) and
877
+ if caseCompletion instanceof NormalOrBooleanCompletion
878
+ then completion = anonymousBreakCompletion ( )
879
+ else completion = caseCompletion
880
+ )
875
881
or
876
882
// ...and if the rhs is an expression we wrap the completion as a yield
877
883
exists ( Completion caseCompletion |
Original file line number Diff line number Diff line change 1
1
| Test.java:5:7:5:17 | case ... | Test.java:3:20:3:20 | s | Test.java:5:12:5:14 | "c" | true | true | Test.java:5:7:5:17 | case ... |
2
2
| Test.java:6:7:6:17 | case ... | Test.java:3:20:3:20 | s | Test.java:6:12:6:14 | "d" | true | true | Test.java:6:7:6:17 | case ... |
3
+ | Test.java:11:7:11:17 | case ... | Test.java:9:13:9:13 | s | Test.java:11:12:11:14 | "c" | true | false | Test.java:13:7:13:16 | default |
4
+ | Test.java:11:7:11:17 | case ... | Test.java:9:13:9:13 | s | Test.java:11:12:11:14 | "c" | true | true | Test.java:11:7:11:17 | case ... |
5
+ | Test.java:12:7:12:17 | case ... | Test.java:9:13:9:13 | s | Test.java:12:12:12:14 | "d" | true | false | Test.java:13:7:13:16 | default |
6
+ | Test.java:12:7:12:17 | case ... | Test.java:9:13:9:13 | s | Test.java:12:12:12:14 | "d" | true | true | Test.java:12:7:12:17 | case ... |
You can’t perform that action at this time.
0 commit comments