JDK-6282460 : Legal cast rejected
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2005-06-08
  • Updated: 2010-04-02
  • Resolved: 2005-08-04
Related Reports
Duplicate :  
Description
This program doesn't compile

public class X {

    public interface SuperInterface<A> {
    }

    public interface SubInterface extends SuperInterface<String> {
        public String getString();
    }

    private SuperInterface< ? extends SuperInterface> x = null;

    public void f() {
        ((SubInterface) this.x).getString();
    }
}

###@###.### 2005-06-08 16:13:28 GMT