5.6 For-In Statements

In a ‘for-in’ statement of the form

  1. for (v in expr) statement

v must be an expression classified as a reference of type Any or the String primitive type, and expr must be an expression of type Any, an object type, or a type parameter type.

In a ‘for-in’ statement of the form

  1. for (var v in expr) statement

v must be a variable declaration without a type annotation that declares a variable of type Any, and expr must be an expression of type Any, an object type, or a type parameter type.