Robert Tweed wrote:
When you specify a type, you are declaring an object to the compiler. Based on that, the compiler will check the code for any expressions that conflict with the known declaration. It can only do this at compile-time: there is no runtime type-checking.

When you use a path reference, you are doing one of three things:

1. Dereferencing a typed variable, which must be declared somewhere else.
2. Dereferencing an existing dynamic variable.
3. Creating a dynamic variable at runtime.

The reasons why none of these can legally have a type specifier:

1. You can't declare something twice - the compiler already knows the type.
2. By definition, you can't know what type it is, so trying to specify one here is a form of unsafe casting.

So what you're saying is, when I declare a variable using a path reference, I'm really creating a dynamic variable. Because the type of a dynamic variable is only determined at runtime when the variable is given a value, and type checking is done at compile-time, you can't typecast an object as Number when it's already been typecast as dynamic at compile-time? Or is it the reverse? Still a little confused...

3. In this case any declaration to the compiler is meaningless.

- Robert
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to