Bug 106010 - [1.5][compiler] Wrong warning message issued in generic nesting type casting
Summary: [1.5][compiler] Wrong warning message issued in generic nesting type casting
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 100809 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-03 22:49 EDT by Rice Yeh CLA
Modified: 2005-10-28 13:46 EDT (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 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