Bug 77052

Summary: [1.5] Type mismatch on embedded type parameters
Product: [Eclipse Project] JDT Reporter: Bart Geraci <BJGeraci>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: java, mlq.eclipse
Version: 3.0   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Bart Geraci CLA 2004-10-26 16:14:36 EDT
Version 3.1, Build 200410260800, Java 1.5

The following code compiles without problem using javac, but Eclipse reports a
problem as stated in the comment.

====================
interface M<X> { }

class N<C> { 
  M<N<C>> pni = null;
}

class O<I> {
  N<I> var1 = null;

  M<N<I>> var2 = var1.pni;
  // Above line reports as error in Eclipse. 
  // "var2" is underlined and the error message is: 
  // Type mismatch: cannot convert from M<N<C>> to M<N<I>>
}
====================
Comment 1 Bart Geraci CLA 2004-10-26 19:04:33 EDT
I've noticed that if each interface and class were in their own separate files
(M.java, N.java, O.java), then Eclipse does not complain and the resolution is
done properly.
Comment 2 Philipe Mulet CLA 2004-10-27 06:51:43 EDT
Substitution algorithm did not properly handle ParametizedType of GenericType
(no nested type variables).

Fixed. Added regression test: GenericTypeTest#test338
Comment 3 Philipe Mulet CLA 2004-10-27 07:04:13 EDT
*** Bug 72998 has been marked as a duplicate of this bug. ***
Comment 4 Philipe Mulet CLA 2004-10-27 08:10:54 EDT
*** Bug 76313 has been marked as a duplicate of this bug. ***
Comment 5 David Audel CLA 2004-11-04 07:18:48 EST
Verified for 3.1M3 with build I200411040100