Bug 98316

Summary: [1.5][compiler] Applying "Remove cast" QuickFix causes incremental compile error.
Product: [Eclipse Project] JDT Reporter: Brian Miller <bmiller>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Brian Miller CLA 2005-06-03 12:23:32 EDT
------------------------ Bug.java --------------------------
class Bug<Row>{}
class Derived extends Bug<String>{}
class Type<Row>{ Bug<Row>bug=(Bug)new Derived(); }
Comment 1 Dirk Baeumer CLA 2005-06-03 13:20:09 EDT
IMO the compiler shouldn't flag this as an unnecessary cast in the first place.
Moving to JDT/Core.
Comment 2 Philipe Mulet CLA 2005-06-05 10:54:44 EDT
This is questionnable. Technically, Bug<String> <: Bug, thus the cast doesn't
provide any extra value. It is however permitting some forbidden conversion in
this scenario, and removing the offending cast would reveal the badness in the code.

I would thus favor leaving the warning in, to flag the situation.
Comment 3 Philipe Mulet CLA 2005-07-04 09:39:36 EDT
Will preserve existing behavior as explained above.