Bug 73837

Summary: Java 1.5 generics problem (Eclipse 3.1M1)
Product: [Eclipse Project] JDT Reporter: Ayal Spitz <eclipse>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: 3.0   
Target Milestone: 3.1 M2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Ayal Spitz CLA 2004-09-13 19:44:27 EDT
The following series of classes produce an error (The constructor B<Z>(Z, D<Y>)
is undefined) in the 'test' method of the 'C' class. There appears to be some
problem with multi level generics.

public class D<Y>{}

public class B<X>{
   public B(X str,D dValue){}
}

public class C<Z,Y> {
   public B<Z> test(Z zValue,D<Y> yValue){ return new B<Z>(zValue,yValue); }
}

This appears to work with IntelliJ 4.5
Comment 1 Kent Johnson CLA 2004-09-14 16:31:28 EDT
This case works if all the types are compiled from source but fails if B is 
picked up as .class file.

ParameterizedTypeBinding.isEquivalentTo does not accept BinaryTypeBindings... 
just RawTypeBindings.
Comment 2 Ayal Spitz CLA 2004-09-14 23:19:55 EDT
Building on Kents comment, the temporary work around to this bug is to clean the
project and then rebuild it. Trying this approach out on both the example
outlined and the original, more complex code, seems to do the trick.

I知 interested in helping resolve this bug if possible
Comment 3 Kent Johnson CLA 2004-09-15 16:03:14 EDT
Philippe: double check the fix to BinaryTypeBinding.
Comment 4 Philipe Mulet CLA 2004-09-16 09:54:37 EDT
Fix looks good (matching unresolved scenario). Added GenericTypeTests#test293.
Comment 5 Kent Johnson CLA 2004-09-16 11:27:48 EDT
.
Comment 6 Frederic Fusier CLA 2004-09-24 04:39:47 EDT
Verified for 3.1 M2 with build I200409231635.