Bug 139669 - Problem with static member classes of generic types
Summary: Problem with static member classes of generic types
Status: RESOLVED DUPLICATE of bug 139525
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-02 09:32 EDT by Dirk Willecke CLA
Modified: 2006-05-02 10:25 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 Dirk Willecke CLA 2006-05-02 09:32:48 EDT
Using 3.2RC2 I get error messages with:

--- File A.java ---
public interface A<T> {
  void foo(A.C c);
  class C {}
}

--- File B.java ---
public class B<T> implements A<T> {
  public void foo(A.C c) {}
}

Error: Name clash: The methode foo(A.C) of type B<T> has the same erasure as foo(A.C) of type A<T> but does not override it.

Error: The type B<T> must implement the inherited abstract method A<T>.foo(A.C).

If you don't get the error immediately, please try to comment the line "class C {}", compile (obviously with errors), and then uncomment the line again.

After "Clean all projects" and rebuild, the error messages will vanish. But you can reforce them with the comment/uncomment step.

This bug doesn't occur with 3.2RC1 !

The bug doesn't occur, if A and B are not generic.

The same problem occurs, if A is a class:

--- File A.java ---
public class A<T> {
  public void foo(A.C c);
  public static class C {}
}

--- File B.java ---
public class B<T> extends A<T> {
  public void foo(A.C c) {}
}
Comment 1 Dirk Willecke CLA 2006-05-02 10:08:34 EDT
I just see, this seems to be a duplicate of 139525.
Comment 2 Olivier Thomann CLA 2006-05-02 10:11:27 EDT
I will add a corresponding regression test for it.
Thanks for reporting it anyway.
Comment 3 Olivier Thomann CLA 2006-05-02 10:25:07 EDT
Added org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test0978/0979

*** This bug has been marked as a duplicate of 139525 ***