Community
Participate
Working Groups
If an upper-bounded type parameter (say, <T extends Foo>) of a generic class is bound in a reference to <?>, it should not be interpreted as <? extends Object>, but as <? extends Foo>. The JDT compiler behaves correctly. However, the "content assist" feature and "extract local variable" both infer Object as the type parameter for methods called on this reference. How to reproduce: class Noop<T extends Collection> { T value; T get() {return value;} } Noop<?> noop = // IMPORTANT! <?> here really means <? extends Collection> new Noop<Set>() {{ value = new HashSet(); }}; noop.get().size(); // this compiles, as should be noop.get(); // extract local variable believes get() returns an Object, and there is no hover noop.<<CTRL+SPACE>> // content assist also thinks that get() returns an Object Forgive me if there are any duplicates of this.
Anirban, please take a look at this.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.