Variable's DA status not changing within body of closure

Neal Gafter neal at gafter.com
Sun May 18 13:52:29 PDT 2008


This is correct.  The fact that the exec method definitely executes the
closure it receives is not part of its type.

On Sun, May 18, 2008 at 7:17 AM, Mark Mahieu <mark at twistedbanana.demon.co.uk>
wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/closures-dev/attachments/20080518/2735aa01/attachment.html 


More information about the closures-dev mailing list