[intention-preview] Create record on record pattern: fix an exception when the record component pattern list is empty

IDEA-304933

GitOrigin-RevId: f0fe135f3bddf5e5705f76de8ebe095543bd18a8
This commit is contained in:
Andrey Cherkasov
2022-10-28 16:40:46 +04:00
committed by intellij-monorepo-bot
parent e056e25116
commit d0c57ae46f
6 changed files with 46 additions and 1 deletions

View File

@@ -0,0 +1,12 @@
// "Create record 'EmptyBox'" "true-preview"
class Test {
void foo(Object obj) {
switch (obj) {
case EmptyBox() -> System.out.println( "Fill it up and send it back");
default -> {}
}
}
}
public record EmptyBox() {
}

View File

@@ -0,0 +1,9 @@
// "Create record 'EmptyBox'" "true-preview"
class Test {
void foo(Object obj) {
switch (obj) {
case Empty<caret>Box() -> System.out.println( "Fill it up and send it back");
default -> {}
}
}
}