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

The Java language should allow covariant method return types

XMLWordPrintable

    • generic
    • generic

      Name: gb36485 Date: 11/18/98


      The Java virtual machine, for reasons of binary compatibility, already
      allows a method to be overridden by a method of the same signature
      but with a return type which is a subtype of the method it overrides.

      For greater type safety, the Java language should remove the restriction
      that overriding methods must have the same return type as the methods
      they override.

      I will submit a more detailed proposal, including changes to the JLS, in
      the future.

      Note that this is a 100% compatible change.
      (Review ID: 42168)
      ======================================================================

            gbrachasunw Gilad Bracha (Inactive)
            gbrachasunw Gilad Bracha (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: