[Laszlo-dev] Bracket syntax notation in AS3

André Bargull andre.bargull at udo.edu
Mon Nov 3 09:33:19 PST 2008


Ok, I've created "http://bugs.adobe.com/jira/browse/ASC-3574".

On 11/3/2008 4:53 PM, P T Withington wrote:
> I would say it is a Flex bug.  I bet their expander for ++ is just 
> screwing up somehow, probably incorrectly trying to increment 'count' or 
> something.  I would file a bug with Adobe.
> 
> On 2008-11-01, at 10:41EDT, André Bargull wrote:
> 
>> Can anyone explain to me, why `++(o['count'])` fails to compile for 
>> AS3? Thanks!
>>
>>> <canvas>
>>>  <handler name="oninit" >
>>>    var o = {count:0};
>>>    if (++(o.count) == 1) Debug.write("it's one");
>>> //Error: Implicit coercion of a value of type String to an unrelated 
>>> type Number, in line: if (++$2["count"] == 2) {
>>> //Error: Comparison between a value with static type String and a 
>>> possibly unrelated type int, in line: if (++$2["count"] == 2) {
>>> //    if (++(o['count']) == 2) Debug.write("it's two");
>>> //Error: Operand of increment must be a reference, in line: if 
>>> (++(o["count"] as int) == 3) {
>>> //    if (++(o['count'] cast int) == 3) Debug.write("it's three");
>>> //Error: Operand of increment must be a reference, in line: if 
>>> (++int(o["count"]) == 4) {
>>> //    if (++(int(o['count'])) == 4) Debug.write("it's four");
>>>  </handler>
>>> </canvas>
>>
> 
> 



More information about the Laszlo-dev mailing list