mirror of
https://github.com/github/codeql.git
synced 2026-04-23 07:45:17 +02:00
Add tests for case statement type test dominance against anonymous labels and fall-through
This commit is contained in:
@@ -58,6 +58,23 @@ public class Test {
|
||||
case null: default: i.take(source()); // Can't call C1.take (but we don't currently notice)
|
||||
}
|
||||
|
||||
switch(i) {
|
||||
case C1 _, C2 _:
|
||||
i.take(source()); // Must be either C1.take or C2.take (but we don't currently notice, because neither dominates)
|
||||
break;
|
||||
default:
|
||||
i.take(source()); // Can't call C1.take or C2.take (but we don't currently notice, because a multi-pattern case isn't understood as a type test)
|
||||
}
|
||||
|
||||
switch(i) {
|
||||
case C1 _:
|
||||
case C2 _:
|
||||
i.take(source()); // Must be either C1.take or C2.take (but we don't currently notice, because neither dominates)
|
||||
break;
|
||||
default:
|
||||
i.take(source()); // Can't call C1.take or C2.take
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
//semmle-extractor-options: --javac-args --release 21
|
||||
//semmle-extractor-options: --javac-args --release 22
|
||||
|
||||
@@ -30,3 +30,17 @@
|
||||
| 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 |
|
||||
| Test.java:63:16:63:23 | source(...) | Test.java:7:65:7:65 | x |
|
||||
| Test.java:63:16:63:23 | source(...) | Test.java:8:65:8:65 | x |
|
||||
| Test.java:63:16:63:23 | source(...) | Test.java:9:74:9:74 | x |
|
||||
| Test.java:63:16:63:23 | source(...) | Test.java:10:82:10:82 | x |
|
||||
| Test.java:66:16:66:23 | source(...) | Test.java:7:65:7:65 | x |
|
||||
| Test.java:66:16:66:23 | source(...) | Test.java:8:65:8:65 | x |
|
||||
| Test.java:66:16:66:23 | source(...) | Test.java:9:74:9:74 | x |
|
||||
| Test.java:66:16:66:23 | source(...) | Test.java:10:82:10:82 | x |
|
||||
| Test.java:72:16:72:23 | source(...) | Test.java:7:65:7:65 | x |
|
||||
| Test.java:72:16:72:23 | source(...) | Test.java:8:65:8:65 | x |
|
||||
| Test.java:72:16:72:23 | source(...) | Test.java:9:74:9:74 | x |
|
||||
| Test.java:72:16:72:23 | source(...) | Test.java:10:82:10:82 | x |
|
||||
| Test.java:75:16:75:23 | source(...) | Test.java:9:74:9:74 | x |
|
||||
| Test.java:75:16:75:23 | source(...) | Test.java:10:82:10:82 | x |
|
||||
|
||||
Reference in New Issue
Block a user