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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 10
    • 10
    • specification

      [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

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

              Created:
              Updated:
              Resolved: