Bug 98316 - [1.5][compiler] Applying "Remove cast" QuickFix causes incremental compile error.
Summary: [1.5][compiler] Applying "Remove cast" QuickFix causes incremental compile er...
Status: RESOLVED WONTFIX
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.1.1   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-03 12:23 EDT by Brian Miller CLA
Modified: 2005-07-04 09:39 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 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.