Other |
---|
tbdUnresolved |
Duplicate :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
|
Relates :
|
In: static <T> T choose(boolean b, T trueValue, T falseValue) { return b ? trueValue : falseValue; } boolean b = false; List<? super Number> s = null; s = b ? s : s; s = choose(b, s, s); Inference can't handle lower/super bounded wildcards leading to errors like: Choose.java:10: incompatible types found : java.util.List<capture of ? extends java.lang.Object> required: java.util.List<? super java.lang.Number> s = b ? s : s; ^ Choose.java:11: incompatible types found : java.util.List<capture of ? extends java.lang.Object> required: java.util.List<? super java.lang.Number> s = choose(b, s, s); ^ See the attached file Choose.java ###@###.### 2004-05-25
|