mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
wildcard substitution partly reverted (IDEA-122700)
This commit is contained in:
+1
-1
@@ -311,7 +311,7 @@ class WithingBounds {
|
||||
A<A<<error descr="Type parameter 'A' is not within its bound; should extend 'A<A>'">A</error>>> a3;
|
||||
|
||||
A<? extends A> a4;
|
||||
A<<error descr="Type parameter '? super A' is not within its bound; should extend 'A<A<T>>'">? super A</error>> a5;
|
||||
A<<error descr="Type parameter '? super A' is not within its bound; should extend 'A<? super A>'">? super A</error>> a5;
|
||||
A<<error descr="Type parameter 'A[]' is not within its bound; should extend 'A<A[]>'">A[]</error>> a7;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -20,7 +20,7 @@ class Bug2<T extends Integer>{
|
||||
}
|
||||
|
||||
void bug1(Parametrized<? super T> param) {
|
||||
foo(param);
|
||||
<error descr="Inferred type 'capture<? super T>' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ class Test {
|
||||
}
|
||||
|
||||
void bug1(Parametrized<? super T> param) {
|
||||
<error descr="Inferred type 'java.io.Serializable' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
|
||||
<error descr="Inferred type 'capture<? super T>' for type parameter 'I' is not within its bound; should extend 'java.lang.Number'">foo(param)</error>;
|
||||
}
|
||||
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
class Test {
|
||||
class Event {}
|
||||
class KeyEvent extends Event {
|
||||
int getCode() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
interface EventListener<T extends Event> {
|
||||
void handle(T event);
|
||||
}
|
||||
|
||||
class EventType<T extends Event>{}
|
||||
static final EventType<KeyEvent> KEY_PRESSED = null;
|
||||
|
||||
{
|
||||
addEventHandler(KEY_PRESSED, keyEvent -> {
|
||||
int i = keyEvent.getCode();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public final <T extends Event> void addEventHandler(final EventType<T> eventType, final EventListener<? super T> listener) {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user