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

javac, JLS8 18.2.4 is not completely implemented by the compiler

XMLWordPrintable

    • b126
    • Verified

      There are cases where instantiation shouldn't be used by the compiler like for inferring the parameterization of functional interfaces, avoiding instantiation for this case has uncovered the issue. In particular the part of the spec that is not implemented is the one concerning wildcards:

      ...
      A constraint formula of the form ‹ S = T ›, where S and T are type arguments (§4.5.1),
      is reduced as follows:
      • If S and T are types, the constraint is reduced as described above.
      • If S has the form ? and T has the form ? , the constraint reduces to true.
      • If S has the form ? and T has the form ? extends T' , the constraint reduces to
      ‹ Object = T' ›.
      • If S has the form ? extends S' and T has the form ? , the constraint reduces to
      ‹ S' = Object ›.
      • If S has the form ? extends S' and T has the form ? extends T' , the constraint
      reduces to ‹ S' = T' ›.
      • If S has the form ? super S' and T has the form ? super T' , the constraint reduces
      to ‹ S' = T' ›.
      • Otherwise, the constraint reduces to false.

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: