Bug 474870 - Invalid unchecked warning when casting types with multiple type variables
Summary: Invalid unchecked warning when casting types with multiple type variables
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-13 05:17 EDT by Emond Papegaaij CLA
Modified: 2024-02-19 03:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emond Papegaaij CLA 2015-08-13 05:17:01 EDT
When compiling the following code:

public class Test {
  public static class Single<A>	{ }
  public static class Dual<A, B> extends Single<A> { }

  public Test() {
    Single<String> test = new Single<>();
    Dual<String, ? > test2 = (Dual<String, ? >) test;
  }
}

ECJ gives the warning 'Type safety: Unchecked cast from Test.Single<String> to Test.Dual<String,?>', which it should not. The first type parameter is already bound to 'String', so there's no unchecked cast. javac does not give a warning.
Comment 1 Eclipse Genie CLA 2020-09-20 02:51:28 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 2 Emond Papegaaij CLA 2020-09-20 15:18:19 EDT
This but still exists in 4.16. I still get the same warning.
Comment 3 Clovis Seragiotto CLA 2022-02-26 11:54:40 EST
Still reproducible with 4.22.
Comment 4 Eclipse Genie CLA 2024-02-18 14:16:36 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 5 Emond Papegaaij CLA 2024-02-19 03:22:07 EST
This bug is no longer reproducible in 4.30, so it can be closed.