mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-30 19:19:40 +07:00
Fixes IDEA-326353 Generics error is not displayed in new expression GitOrigin-RevId: 661bf57ed3451096fcee245204dd30adae49e9e1
28 lines
1.2 KiB
Java
28 lines
1.2 KiB
Java
|
|
class EnumBug {
|
|
static class Enum<E extends Enum<E>> {
|
|
}
|
|
|
|
static class Option<T> extends Enum<Option<T>> {
|
|
}
|
|
|
|
static class EnumSet<E extends Enum<E>> {
|
|
static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) {
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
EnumSet<<error descr="Type parameter 'EnumBug.Option' is not within its bound; should extend 'EnumBug.Enum<EnumBug.Option<?>>'">Option<?></error>> enumSet = EnumSet.<<error descr="Type parameter 'EnumBug.Option' is not within its bound; should extend 'EnumBug.Enum<EnumBug.Option<?>>'">Option<?></error>>noneOf(Option.class);
|
|
EnumSet<<error descr="Type parameter 'EnumBug.Option' is not within its bound; should extend 'EnumBug.Enum<EnumBug.Option>'">Option</error>> enumSetRaw = EnumSet.<Option>noneOf(Option.class);
|
|
}
|
|
|
|
void consume(Runnable r) {}
|
|
|
|
void test() {
|
|
EnumSet<<error descr="Type parameter 'EnumBug.Option' is not within its bound; should extend 'EnumBug.Enum<EnumBug.Option>'">Option</error>> set = null;
|
|
consume(() -> {
|
|
EnumSet<<error descr="Type parameter 'EnumBug.Option' is not within its bound; should extend 'EnumBug.Enum<EnumBug.Option>'">Option</error>> set1 = null;
|
|
});
|
|
}
|
|
} |