Details
-
Type:
Bug
-
Status: Closed
-
Priority:
P3
-
Resolution: Fixed
-
Affects Version/s: 10
-
Fix Version/s: 10
-
Component/s: specification
-
Labels:
-
Subcomponent:
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
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