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


   A simple test like
   ```
   
   public class LambdaTest {
   
       private var someField: String;
   
       private var lambdaField:Function = function ():void {
           assertEquals(someField, "test");
       };
   
       [Test]
       public function testLambda():void {
           someField = "test";
           assertEquals(someField, "test");
           lambdaField()
       }
   
   }
   ```
   compiles fine but fails in runtime with error `expected <undefined> to be 
equal to <test>`
   
   
   Interesting that changing 
   ```
       private var lambdaField:Function = function ():void {
           assertEquals(someField, "test");
       };
   ```
   to
   ```
       private var lambdaField:Function = lambdaFieldDefault;
   
       private function lambdaFieldDefault():void {
           assertEquals(someField, "test");
       }
   ```
   fixes the issue.


----------------------------------------------------------------
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:
[email protected]


Reply via email to