mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-24 15:31:26 +07:00
- try to calculate generics for generic sealed classes using a selector type GitOrigin-RevId: 80fafc8f359a8841814f0e13f87f67d4e81039cb
26 lines
563 B
Java
26 lines
563 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<caret>) {
|
|
};
|
|
}
|
|
}
|
|
|
|
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> {
|
|
}
|
|
|
|
} |