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

4.10: Define subtyping for inner classes of parameterized types

    XMLWordPrintable

Details

    Description

      It is not clear how subtyping among inner classes of parameterized types should be handled:

      - Are Foo<Integer>.Bar and Foo<Double>.Bar distinct classes? Or do we need to assert, for subtyping, that the enclosing class types need to be equal?

      - How do we handle Parent<Integer>.Bar vs. Child.Bar (Child extends Parent<Integer>)?

      - Do wildcard-parameterized types have inner classes at all? If so, is Foo<Integer>.Bar a subtype of Foo<? extends Number>.Bar?

      - Presumably Foo.Bar is a supertype of Foo<Integer>.Bar?

      - Foo<Integer>.Bar is not a parameterized type, right? Do we ever overlook this fact, and assume a non-parameterized class type is the same as its erasure? (See, e.g., 5.1.10.)

      Generally, much of Chapter 4 needs to be examined with such types in mind.

      Attachments

        Issue Links

          Activity

            People

              dlsmith Dan Smith
              dlsmith Dan Smith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: