3.4.1 Type errors

Here is an example of a program that is valid in the standard dialect but not valid in the strict dialect:

class A {}
class B extends A {}
var a : A = new B
var b : B = a        // type error, static type of 'a' is A,
                     // which is incompatible with B

In the standard dialect this program has no error, since type errors are runtime errors and the runtime value of a is an instance of B, which is clearly a member of the type B.


 

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

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