Note we can't prove certain unreachable callables when 'case null' is present

This commit is contained in:
Chris Smowton
2023-11-17 11:10:06 +00:00
parent 89f7e7f76a
commit c11a260369
2 changed files with 11 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ public class Test {
switch(i) {
case C1 c1 -> { }
case null, default -> i.take(source()); // Can't call C1.take
case null, default -> i.take(source()); // Can't call C1.take (but we don't currently notice)
}
switch(i) {
@@ -53,6 +53,11 @@ public class Test {
default -> i.take(source()); // Could call any implementation, because this might be a WrapperWrapper(Wrapper((Integer)) for example.
}
switch(i) {
case C1 c1: break;
case null: default: i.take(source()); // Can't call C1.take (but we don't currently notice)
}
}
}

View File

@@ -5,6 +5,7 @@
| Test.java:23:25:23:32 | source(...) | Test.java:8:65:8:65 | x |
| Test.java:23:25:23:32 | source(...) | Test.java:9:74:9:74 | x |
| Test.java:23:25:23:32 | source(...) | Test.java:10:82:10:82 | x |
| Test.java:28:36:28:43 | source(...) | Test.java:7:65:7:65 | x |
| Test.java:28:36:28:43 | source(...) | Test.java:8:65:8:65 | x |
| Test.java:28:36:28:43 | source(...) | Test.java:9:74:9:74 | x |
| Test.java:28:36:28:43 | source(...) | Test.java:10:82:10:82 | x |
@@ -25,3 +26,7 @@
| Test.java:53:25:53:32 | source(...) | Test.java:8:65:8:65 | x |
| Test.java:53:25:53:32 | source(...) | Test.java:9:74:9:74 | x |
| Test.java:53:25:53:32 | source(...) | Test.java:10:82:10:82 | x |
| Test.java:58:34:58:41 | source(...) | Test.java:7:65:7:65 | x |
| Test.java:58:34:58:41 | source(...) | Test.java:8:65:8:65 | x |
| Test.java:58:34:58:41 | source(...) | Test.java:9:74:9:74 | x |
| Test.java:58:34:58:41 | source(...) | Test.java:10:82:10:82 | x |