Skip to main content
Participant
March 5, 2013
Question

Non-trivial inline cases problem.

  • March 5, 2013
  • 1 reply
  • 330 views

I have problems when trying to inline functions  that aren't just  trivial expressions using getters or simple math function wrappers. I have AIR SDK 3.6 with stable ASC 2.0.

First problems is somewhat related to array access operator. I have:

class A {

     private var _field:int;

     ...

    [Inline]

    public final function get field():int {

        return _field;

    }

}

...

var items:Vector.<A>;

...

//FIRST CASE -  doesn't work

tmp += items.field;

//SECOND CASE - works!

var item:A = items;

tmp += item.field;

In first case getter won't get inlined, while in second case it will. Why? Vector is typed strongly enough to inferre the type of access operator expression I think.

Second issue:

class B {

     private var _field:int;

     [Inline]

     public final function get field():int {

          return _field;

     }

}

class A {

     public var b:B;

     [Inline]

     public final function get field():int {

          return b.field;

     }

}

var a:A;

tmp = a.field;


The field getter from A won't get inlined. Is this issue already known? How to deal with it. It is serious limitation of inlining feature.

This topic has been closed for replies.

1 reply

chris.campbell
Legend
March 7, 2013

Would you cross posting this over on the ActionScript forums?

http://forums.adobe.com/community/flash/flash_actionscript3