Variable's DA status not changing within body of closure

Mark Mahieu mark at twistedbanana.demon.co.uk
Sun May 18 07:17:35 PDT 2008


This doesn't look quite right:


public class DefinitelyAssigned {

     public static void main(String[] args) {

         int i;

         exec() {
             i = 0;
             i++;
         }
     }

     static void exec({==>void} block) {
         block.invoke();
     }
}


DefinitelyAssigned.java:9: variable i might not have been initialized
                         i++;
                         ^
1 error



Regards,

Mark



More information about the closures-dev mailing list