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

Inference: define supertype parameterization for wildcard-parameterized types

    Details

      Description

      Reduction of subtyping constraints (ArrayList<?> <: List<? super alpha>) invokes capture in javac, leading to incorrect constraints on ivars involving capture vars; these new types also foil the argument that incorporation will terminate.

      The correct behavior is unspecified: what is the parameterization of List that is a supertype of ArrayList<?>? How do we derive it?

        Issue Links

          Activity

          Hide
          dlsmith Dan Smith added a comment -
          This question is also relevant for lub (4.10.4).
          Show
          dlsmith Dan Smith added a comment - This question is also relevant for lub (4.10.4).
          Hide
          dlsmith Dan Smith added a comment -
          Inference also encounters the problem in incorporation (18.3.1): when it's necessary to find "a supertype of S of the form G<S1, ..., Sn>" and "a supertype of T of the form G<T1, ..., Tn>", we need to know whether "S1 = T1" is a valid new constraint -- which depends on whether S1 is a wildcard or not.
          Show
          dlsmith Dan Smith added a comment - Inference also encounters the problem in incorporation (18.3.1): when it's necessary to find "a supertype of S of the form G<S1, ..., Sn>" and "a supertype of T of the form G<T1, ..., Tn>", we need to know whether "S1 = T1" is a valid new constraint -- which depends on whether S1 is a wildcard or not.
          Hide
          dlsmith Dan Smith added a comment -
          Also a problem for interpreting inherited inner classes of wildcard-parameterized types (JDK-8030746): what are the type arguments of the enclosing class?

          class Parent<T> { class C {} }
          class Child<T> extends Parent<Foo<T>> {}

          Child<?>.C // means Parent<???>.C
          Show
          dlsmith Dan Smith added a comment - Also a problem for interpreting inherited inner classes of wildcard-parameterized types ( JDK-8030746 ): what are the type arguments of the enclosing class? class Parent<T> { class C {} } class Child<T> extends Parent<Foo<T>> {} Child<?>.C // means Parent<???>.C

            People

            • Assignee:
              dlsmith Dan Smith
              Reporter:
              dlsmith Dan Smith
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: