Fix pretty-printing of anonymous vars and multiple patterns; add test

This commit is contained in:
Chris Smowton
2024-03-22 20:51:10 +00:00
parent f317f782ae
commit 5cb5ee026c
4 changed files with 26 additions and 7 deletions

View File

@@ -45,6 +45,13 @@ public class Test {
if (o instanceof R(S(var x), var y)) { }
switch(o) {
case String _, Integer _:
case R(S(_), _):
default:
break;
}
}
}

View File

@@ -1 +1 @@
//semmle-extractor-options: --javac-args --release 21
//semmle-extractor-options: --javac-args --release 22

View File

@@ -84,5 +84,11 @@
| Test.java:1:14:1:17 | Test | 83 | } |
| Test.java:1:14:1:17 | Test | 84 | if (o instanceof R(S(var x), var y)) { |
| Test.java:1:14:1:17 | Test | 85 | } |
| Test.java:1:14:1:17 | Test | 86 | } |
| Test.java:1:14:1:17 | Test | 87 | } |
| Test.java:1:14:1:17 | Test | 86 | switch (o) { |
| Test.java:1:14:1:17 | Test | 87 | case String _, Integer _: |
| Test.java:1:14:1:17 | Test | 88 | case R(S(var _), var _): |
| Test.java:1:14:1:17 | Test | 89 | default: |
| Test.java:1:14:1:17 | Test | 90 | break; |
| Test.java:1:14:1:17 | Test | 91 | } |
| Test.java:1:14:1:17 | Test | 92 | } |
| Test.java:1:14:1:17 | Test | 93 | } |