Bug 91021

Summary: [1.5][compiler] Incorrect type safety warning for a generic inner type
Product: [Eclipse Project] JDT Reporter: cimlj
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

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 ***