You need `var info:ReturnedJSON = JSON.parse(service.data) as ReturnedJSON;`

There’s two ways to ignore coercion. One is by using the comment, the second is 
using the compiler option for the whole project.

> On Nov 27, 2017, at 10:58 AM, Justin Mclean <jus...@classsoftware.com> wrote:
> 
> Hi,
> 
>> Use ignore as coercions.
> 
> I assume you mean like so:
> 
> /*
> *@royaleignorecoercion ReturnedJSON
> */
> public function projectInfo(event:Event):void {
>    var info:ReturnedJSON = JSON.parse(service.data);
> 
> (where ReturnedJSON is the suggested interface)
> 
> That fails to compile with:
> Implicit coercion of a value with static type Object to a possibly unrelated 
> type ReturnedJSON.
> 
> Adding “as ReturnedJSON” makes it compile (like before) but info again info 
> ends up being null. 
> 
> Thanks for the suggestions but think we’re back to square one here.
> 
> Thanks,
> Justin

Reply via email to