Add CFG test for anonymous variables and fall-throughs with pattern cases

This commit is contained in:
Chris Smowton
2024-03-22 16:31:15 +00:00
parent cc8dcf63b0
commit 6cf956d07a
3 changed files with 100 additions and 24 deletions

View File

@@ -98,6 +98,24 @@ public class Test {
break;
}
switch(thing) {
case B(_, _):
case Integer _, String _, A(_, _) when thing.toString().equals("abc"):
case Float _:
break;
default:
break;
}
var result = switch(thing) {
case B(_, _):
case Integer _, String _, A(_, _) when thing.toString().equals("abc"):
case Float _:
yield 1;
default:
yield 2;
};
}
}