Bug 112499 - [1.5][compiler] Overriding a method with a type variable with two bounds
Summary: [1.5][compiler] Overriding a method with a type variable with two bounds
Status: RESOLVED DUPLICATE of bug 107105
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: 2005-10-13 11:07 EDT by Rémi Forax CLA
Modified: 2005-10-19 14:51 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 Rémi Forax CLA 2005-10-13 11:07:35 EDT
This code works with javac not with eclipse.
javac generate a funny bridge method :)

public class InterfaceBoundTest {
  static class A {
    <T extends Cloneable & Iterable> T m() {
      return null;
    }
  }
  static class B extends A {
    @Override <T extends Iterable & Cloneable> T m() {
      return null;
    }
  }
}

Rémi Forax
Comment 1 Olivier Thomann CLA 2005-10-18 13:59:39 EDT
For:
[public class X {
  static class A {
    <T extends Cloneable & Iterable> T m() {
      return null;
    }
  }
  static class B extends A {
    @Override <T extends Iterable & Cloneable> T m() {
      return null;
    }
  }
}
]
We report:
----------
1. ERROR in D:\tests_sources\X.java
 (at line 8)
	@Override <T extends Iterable & Cloneable> T m() {
	                                             ^^^
The method m() of type X.B must override a superclass method
----------
1 problem (1 error)
Comment 2 Kent Johnson CLA 2005-10-19 14:51:44 EDT

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