mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
also fixes internationalization and the incorrect comma in the name for "Create missing switch branches" quick-fix GitOrigin-RevId: 16285e054447d8d15318df8889499bbbf91243a7
28 lines
643 B
Java
28 lines
643 B
Java
// "Create missing branches 'Test.Bar' and 'Test.Foo'" "true-preview"
|
|
import java.util.List;
|
|
|
|
class Test {
|
|
public static void main(String[] args) {
|
|
List<Example<String, Integer>> examples = List.of();
|
|
|
|
for (Example<String, Integer> example : examples) {
|
|
String res = switch (example) {
|
|
case Bar<Integer> v -> null;
|
|
case Foo<String, Integer, ?> v -> null;
|
|
};
|
|
}
|
|
}
|
|
|
|
interface AB<A, B> {
|
|
}
|
|
|
|
sealed interface Example<A, B> extends AB<A, B> permits Foo, Bar {
|
|
}
|
|
|
|
record Foo<A, B, C>(A a, C c) implements Example<A, B> {
|
|
}
|
|
|
|
static final class Bar<B> implements Example<String, B> {
|
|
}
|
|
|
|
} |