6.5 Untyped versus typed properties

A property without a type annotation or with the wildcard annotation * (as in var x : *) is said to be untyped. Writing to an untyped property will always succeed since an untyped property can hold any value. Expressions that read from an untyped property are said to be untyped expressions. Assignment from an untyped expression may or may not succeed at runtime depending on whether its value can be implicitly converted to the destination type. Nevertheless, in the strict dialect, assignments from untyped expressions are always type-checked at runtime, as in the standard dialect.

Use untyped properties when you want to store the result of an untyped expression or undefined as one of the values, or when you want to defer type checking to runtime.


 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/specs/actionscript/3/as3_specification57.html