File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
java/ql/test/library-tests/switch-default-impossible-dispatch Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public static void test(int unknown, int alsoUnknown) {
25
25
26
26
switch (i ) {
27
27
case C1 c1 -> { }
28
- case null , default -> i .take (source ()); // Can't call C1.take
28
+ case null , default -> i .take (source ()); // Can't call C1.take (but we don't currently notice)
29
29
}
30
30
31
31
switch (i ) {
@@ -53,6 +53,11 @@ case WrapperWrapper(Wrapper(String s)) -> { }
53
53
default -> i .take (source ()); // Could call any implementation, because this might be a WrapperWrapper(Wrapper((Integer)) for example.
54
54
}
55
55
56
+ switch (i ) {
57
+ case C1 c1 : break ;
58
+ case null : default : i .take (source ()); // Can't call C1.take (but we don't currently notice)
59
+ }
60
+
56
61
}
57
62
58
63
}
Original file line number Diff line number Diff line change 5
5
| Test.java:23:25:23:32 | source(...) | Test.java:8:65:8:65 | x |
6
6
| Test.java:23:25:23:32 | source(...) | Test.java:9:74:9:74 | x |
7
7
| Test.java:23:25:23:32 | source(...) | Test.java:10:82:10:82 | x |
8
+ | Test.java:28:36:28:43 | source(...) | Test.java:7:65:7:65 | x |
8
9
| Test.java:28:36:28:43 | source(...) | Test.java:8:65:8:65 | x |
9
10
| Test.java:28:36:28:43 | source(...) | Test.java:9:74:9:74 | x |
10
11
| Test.java:28:36:28:43 | source(...) | Test.java:10:82:10:82 | x |
25
26
| Test.java:53:25:53:32 | source(...) | Test.java:8:65:8:65 | x |
26
27
| Test.java:53:25:53:32 | source(...) | Test.java:9:74:9:74 | x |
27
28
| Test.java:53:25:53:32 | source(...) | Test.java:10:82:10:82 | x |
29
+ | Test.java:58:34:58:41 | source(...) | Test.java:7:65:7:65 | x |
30
+ | Test.java:58:34:58:41 | source(...) | Test.java:8:65:8:65 | x |
31
+ | Test.java:58:34:58:41 | source(...) | Test.java:9:74:9:74 | x |
32
+ | Test.java:58:34:58:41 | source(...) | Test.java:10:82:10:82 | x |
You can’t perform that action at this time.
0 commit comments