Community
Participate
Working Groups
Build Identifier: 20100617-1415 If a class has two methods with generic arguments, one with arguments being subclasses of the other, e.g. : <T> Collection<T> inter(Collection<T> a, Collection<T> b) <T> Set<T> inter(Set<T> a, Set<T> b) then eclipse forgets about the type parameter : in the second method return inter(b, a); yields "Type mismatch: cannot convert from Set<Object> to Set<T>". javac has no problem with this code. If you rename the first method the problem goes away. Reproducible: Always Steps to Reproduce: 1. download both build.xml and CollectionUtils.java 2. put CollectionUtils.java in folder named "src" 3. run ant 4. you should see "CollectionUtils.main() success" 5. try to compile the same class with Eclipse 6. Type mismatch: cannot convert from Set<Object> to Set<T> at line 36
Created attachment 174060 [details] ant build.xml
Created attachment 174061 [details] Class exhibiting the bug
I forgot to add that this used to work in eclipse-jee-galileo-SR1. It stopped working in eclipse-jee-galileo-SR2
(In reply to comment #3) > I forgot to add that this used to work in eclipse-jee-galileo-SR1. It stopped > working in eclipse-jee-galileo-SR2 Regression introduced by the fix for bug 287592. Under investigation.
Created attachment 174167 [details] Patch under consideration
Olivier, please review for 3.6.1 This is a regression introduced in 3.5.2 & 3.6 M3.
(In reply to comment #6) > Olivier, please review for 3.6.1 Easier to review if you start with ParameterizedGenericMethodBinding.java and then look at Scope.java. Other changes logically follow from there.
Looks good.
Released in HEAD for 3.7 M1 Released in 3.6 maintenance stream for 3.6.1
Verified for 3.7M1 using build I20100802-1800
Change status to RESOLVED rather than VERIFIED as this fix needs to be re-verified for 3.6.1
Verified for 3.6.1 using build M20100825-0800.