Skip to main content
Participant
August 20, 2013
Question

ASC2 compiler inlining causes TypeError: Error #1034: Type Coercion failed

  • August 20, 2013
  • 1 reply
  • 491 views

Following test case reproduces error:

AIR SDK: 3.8.0 build 870 and build 1240

Compiler: 2.0.0 build 353981

Repro:

https://gist.github.com/sigman78/6286715

Origin: feathers.controls.supportClasses.TextFieldViewPort

causes: [Fault] exception, information=TypeError: Error #1034: Type Coercion failed: cannot convert Inner@30186e9 to flash.display.Sprite.

'Inner' class w/o 'final' or removing -inline compiler option makes error go away

test() method bytecode (works, no inlining):

     [__go_to_definition_help(pos="257")]

     function test():void     /* disp_id=0 method_id=1 nameIndex = 3 */

     {

       // local_count=1 max_scope=1 max_stack=2 code_len=12

       // method position=493 code position=645

       0    getlocal0   

       1    pushscope   

       2    debugfile          "C:\SandBox\prj_mono\src;experimental;CoercionError.as"  //stringIndex = 26

       4    getlex             private::inner //nameIndex = 1

       6    debugline          15

       8    pushtrue     

       9    setproperty        prop //nameIndex = 8

       11   returnvoid   

     }

test() method bytecode (fails, inlines)

[__go_to_definition_help(pos="257")]

     function test():void    /* disp_id=0 method_id=1 nameIndex = 3 */

     {

       // local_count=3 max_scope=1 max_stack=2 code_len=35

       // method position=493 code position=645

       0    getlocal0   

       1    pushscope   

       2    debugfile          "C:\SandBox\prj_mono\src;experimental;CoercionError.as"  //stringIndex = 26

       4    getlex            private::inner //nameIndex = 1

       6    debugline          15

       8    pushtrue     

       9    setlocal2   

       10   setlocal1   

       11   getlocal1   

       12   getsuper          prop //nameIndex = 8

       14   getlocal2   

       15   debugline          40

       17   ifne              L1

       21   debugline          41

       23   jump              L2

      

       L1:

       27   getlocal2   

       28   getlocal1   

       29   debugline          44

       31   swap         

       32   setsuper          prop //nameIndex = 8

      

       L2:

       34   returnvoid   

     }

This topic has been closed for replies.

1 reply

chris.campbell
Legend
August 21, 2013

Could you please open a new bug report on this over at https://bugbase.adobe.com

 

Once added, please post back with the URL so that others affected can add their comments and votes and I'll ask the team to take a look.

Thanks,

Chris

SiGMan78Author
Participant
August 21, 2013