brianraymes opened a new issue #185:
URL: https://github.com/apache/royale-compiler/issues/185


   "For each" is sporadically unusable as it doesn't seem to actually loop over 
values in many cases (for currently unknown reasons).
   
   **Steps to Reproduce**
   
   Have a for each that should loop over each value in an ArrayList:
   
   ```
   for each (var thing:SomeObject in this.someOtherObject.someArrayList)
       // do something with thing
   ```
   **Expected Results**
   
   The "for each" retrieves each value in the list.
   
   **Actual Results**
   
   The above may work as expected, find one object in the list, or none all 
together. This is consistent between builds, as-in, when I find a case that 
doesn't work, it never seems to work. In this case, the following workaround is 
always successful.
   
   **Workaround**
   
   ```
   for (var i:int = 0; i < this.someOtherObject.someArrayList.length; i++)
   {
       var thing:SomeObject = this.someOtherObject.someArrayList.getItemAt(i) 
as SomeObject;
       // do something with thing
   }
   ```
   
   **Comments**
   
   This seems rather severe as there doesn't appear to be any warning, error, 
or any other useful information to identify what is going wrong. Hopefully this 
is as consistent as I've seen, so I don't have unexpected outcomes in later 
builds beyond test and deployment.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to