Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4041948

Javac allows interfaces to inherit methods with inconsistent signatures.

XMLWordPrintable

    • 1.2beta
    • generic, sparc
    • generic, solaris_2.5.1
    • Not verified


      allan.jacobs@Eng 1997-03-28

      algol% cat n0941501.java
      interface I1{
        int f();
      }
      interface I2 {
        void f() ;
      }
      interface I3 extends I1,I2 { } // error: Return types conflict.
      //class X implements I3 {
      //
      //}
      algol% javac n0941501.java
      algol% ls
      I1.class I2.class I3.class n0941501.java


      Removing the comments from the declaration of class X forces javac
      to check properly. But, users might declare their interfaces in
      separate files and compile their files separately. So, this is a
      compiler bug.


            tturnidgsunw Todd Turnidge (Inactive)
            ajacobssunw Allan Jacobs (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: