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

E instead of T should be specified in assertion invoking upward projection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 10
    • Component/s: specification
    • Labels:

      Description

      [1] contains following assertions:

      If LocalVariableType is var, then let E be derived from the type of the Expression, as follows:

          If the Expression has an array type, then E is the component type of the array type.
          Otherwise, if the Expression has a type that is a subtype of Iterable<X>, for some type X, then E is X.
          Otherwise, the Expression has a type that is a subtype of raw Iterable and E is Object.

      The type of the local variable is the upward projection of T with respect to all synthetic type variables mentioned by T (4.10.5).

      It seems that the last assertion should mention E instead of T, like:

      The type of the local variable is the upward projection of E with respect to all synthetic type variables mentioned by E (4.10.5).

      [1] http://cr.openjdk.java.net/~dlsmith/local-var-inference.html

        Attachments

          Activity

            People

            Assignee:
            abuckley Alex Buckley
            Reporter:
            grakov Georgiy Rakov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: