static class A<T> {
T t;
public void set(T t){
}
public T get(){
return t;
}
}
public static void aSetter(A<?> a){
a.set(a.get());
}
Error:(22, 10) java: method set in class Main.A cannot be applied to given types; required: capture#1 of ? found: java.lang.Object reason: actual argument java.lang.Object cannot be converted to capture#1 of ? by method invocation conversion
Я читал про подстановочные типы и вот что не понял : почему при компиляции метод get тоже не возращает заглушку capture ? Похоже, я не совсем понимаю механизм их создания