mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-10 09:39:37 +07:00
33 lines
876 B
Java
33 lines
876 B
Java
record RecordInterface(I x, I y) {}
|
|
|
|
sealed interface I permits C, D {}
|
|
final class C implements I {}
|
|
final class D implements I {}
|
|
|
|
public class Totality {
|
|
|
|
RecordInterface recordInterface;
|
|
|
|
void test(){
|
|
switch (recordInterface){
|
|
case RecordInterface(I x, I y) -> {}
|
|
case default -> {}
|
|
}
|
|
switch (recordInterface){
|
|
case RecordInterface(I x, I y) r when true-> {}
|
|
case default -> {}
|
|
}
|
|
switch (recordInterface){
|
|
case RecordInterface(I x, I y) -> {}
|
|
}
|
|
switch (recordInterface){
|
|
case <error descr="'switch' has both a total pattern and a default label">RecordInterface r</error> -> {}
|
|
<error descr="'switch' has both a total pattern and a default label">default</error> -> {}
|
|
}
|
|
switch (recordInterface){
|
|
case RecordInterface(I x, C y) -> {}
|
|
case default -> {}
|
|
}
|
|
}
|
|
}
|