I generally agree. I don't think I'd try to do anything inside the ternary
expression reduce.

I'd look at the coerce() method in ABCGeneratingReducer to try to figure
out why it is not being called.


Question for Alex. What error are you seeing on AIR? A TypeError, a
ReferenceError?


-Darrell


On Mon, Sep 30, 2013 at 8:00 PM, Gordon Smith <gosm...@adobe.com> wrote:

> Thanks Darrell.
>
> Here are my answers to Alex's questions:
>
> > Should a complex assignment statement like the above know about the
> destination type as the clauses of the ternary statement are being reduced?
>
> No.
>
> > Is it safe to add a coerce_a before an assignment to a Dictionary?
>
> Yes.
>
> > If so, what would be the recommended way to determine the assignment is
> to a Dictionary?
>
> The compile-time type of foo[bar], where foo has any type (not just
> Dictionary), is type *. So I think it is OK to codegen coerce_a before
> assignment to any foo[bar] expression.
>
> Darrell, do you agree or disagree?
>
> - Gordon
>
>
> -----Original Message-----
> From: Darrell Loverin [mailto:darrell.love...@gmail.com]
> Sent: Monday, September 30, 2013 3:41 PM
> To: dev@flex.apache.org
> Subject: Re: [FALCON] using coerce_a
>
> coerce_a Operation
>
> Coerce a value to the any type.
>
> Format
>
> coerce_a
>
> Forms
>
> Stack
>
> ..., value => ..., value Description
>
> Indicates to the verifier that the value on the stack is of the any type
> (*). Does nothing to value.
>
>
> On Mon, Sep 30, 2013 at 6:03 PM, Gordon Smith <gosm...@adobe.com> wrote:
>
> > Can you remind me what the "a" in coerce_a means?
> >
> > - Gordon
> >
> > -----Original Message-----
> > From: Alex Harui [mailto:aha...@adobe.com]
> > Sent: Monday, September 30, 2013 2:43 PM
> > To: dev@flex.apache.org
> > Subject: [FALCON] using coerce_a
> >
> > 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