Bug 106010

Summary: [1.5][compiler] Wrong warning message issued in generic nesting type casting
Product: [Eclipse Project] JDT Reporter: Rice Yeh <riceyeh>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: artur.brinkmann, bmiller
Version: 3.1   
Target Milestone: 3.2 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Rice Yeh CLA 2005-08-03 22:49:02 EDT
Take the following code as example, an wrong warning message 
"Unnecessary cast from C1<?>.C11[] to C1<T>.C11[]". But the casting is
really needed. Without it, another "type mismatch" error will happen.

example:

class C1<T> {
	
	class C11 {
		
	}
	
	class C12 {
		T t;
		
		C1<T>.C11[] m() {
			C1<T>.C11[] ts = (C1<T>.C11[]) new C1<?>.C11[5];
			
			return ts;
		}
	}

}
Comment 1 Philipe Mulet CLA 2005-09-30 11:36:17 EDT
Will only warn if the cast type exactly matches a supertype, and not only on
compatible matches (using raw or wildcard types).

Added GenericTypeTest#test832
Comment 2 Philipe Mulet CLA 2005-09-30 12:31:34 EDT
*** Bug 100809 has been marked as a duplicate of this bug. ***
Comment 3 Olivier Thomann CLA 2005-10-28 13:46:49 EDT
Verified for 3.2 M3 using build I20051025-0800+JDT/Core v_618a