Gordon, Darrell (mostly)

My latest problem appears to be in assigning to a Dictionary.  For the
following code:

var dict:Dictionary = new Dictionary();
Var i:int;
Dict["foo"] = (i == 0 ? new SomeClass() : new SomeOtherClass());

MXMLC generates a coerce_a after the constructProp for both SomeClass and
SomeOtherClass.
For some reason, FlashPlayer doesn't care if the coerce_a is missing, but
AIR seems to.

The question is, should a complex assignment statement like the above know
about the destination type as the clauses of the ternary statement are
being reduced?  And if so, how would we get that knowledge into the
reducer.

Alternatively, is it safe to add a coerce_a before an assignment to a
Dictionary?  If so, what would be the recommended way to determine the
assignment is to a Dictionary?

Thanks,
-Alex

Reply via email to