Bug 91021 - [1.5][compiler] Incorrect type safety warning for a generic inner type
Summary: [1.5][compiler] Incorrect type safety warning for a generic inner type
Status: RESOLVED DUPLICATE of bug 89274
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-11 12:56 EDT by cimlj CLA
Modified: 2005-04-16 08:31 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cimlj CLA 2005-04-11 12:56:45 EDT
Type safety warning is reported in Eclipse-3.1M6 when using generic static inner
class in a generic outer class. I think that the warning in the method mC is
incorrect in the following code.

class D<U> {
	public D (D<U> anotherD) {
	}
}

public class Construction<S> {
	
	public static class C<T> {
		public C(C<T> anotherC) {
		}
	}

	public void mD(D<S> d) {
		//the following line is OK (no warning reported)
		new D<S>(d);
	}
	
	public void mC(C<S> c) {
		/* type safety warning
		 * (The expression of type Construction.C<S>
		 * needs unchecked conversion to conform to
		 * Construction<S>.C<S>)
		 */
		new C<S>(c);
	}
}
Comment 1 Philipe Mulet CLA 2005-04-11 14:55:10 EDT
Added GenericTypeTest#test583
Comment 2 Philipe Mulet CLA 2005-04-16 08:31:00 EDT

*** This bug has been marked as a duplicate of 89274 ***