File tree Expand file tree Collapse file tree
java/ql/test/library-tests/switch-default-impossible-dispatch Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public static void test(int unknown, int alsoUnknown) {
2525
2626 switch (i ) {
2727 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)
2929 }
3030
3131 switch (i ) {
@@ -53,6 +53,11 @@ case WrapperWrapper(Wrapper(String s)) -> { }
5353 default -> i .take (source ()); // Could call any implementation, because this might be a WrapperWrapper(Wrapper((Integer)) for example.
5454 }
5555
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+
5661 }
5762
5863}
Original file line number Diff line number Diff line change 55| Test.java:23:25:23:32 | source(...) | Test.java:8:65:8:65 | x |
66| Test.java:23:25:23:32 | source(...) | Test.java:9:74:9:74 | x |
77| 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 |
89| Test.java:28:36:28:43 | source(...) | Test.java:8:65:8:65 | x |
910| Test.java:28:36:28:43 | source(...) | Test.java:9:74:9:74 | x |
1011| Test.java:28:36:28:43 | source(...) | Test.java:10:82:10:82 | x |
2526| Test.java:53:25:53:32 | source(...) | Test.java:8:65:8:65 | x |
2627| Test.java:53:25:53:32 | source(...) | Test.java:9:74:9:74 | x |
2728| 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