Bug 77052 - [1.5] Type mismatch on embedded type parameters
Summary: [1.5] Type mismatch on embedded type parameters
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.1 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 72998 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-10-26 16:14 EDT by Bart Geraci CLA
Modified: 2004-11-04 07:18 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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