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

(JSR14) reject implementation with incorrect return type

    • mantis
    • generic
    • solaris_8

      javac must reject this test case:

      class T {
          static abstract class A<T> {
              abstract void f(T t);
              public int f(Integer t) { return 3; }
          }
          static abstract class B extends A<Integer> {
              // error: A<Integer>.f(Integer) returning int can't implement
              // A<Integer>.f(Integer) returning void.
          }
          static class C extends B {}
      }

            gafter Neal Gafter (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: