Variable initialization within closure?
kannan at cakoose.com
Thu Jan 15 13:53:05 PST 2009
I'm not sure if this behavior is defined by the spec or a bug in the
x = 1;
System.out.println(x); // javac: variable x might not have been
I realize that 'x' shouldn't be considered definitely assigned after
the closure. But it seems unintuitive that 'x' would not be
definitely assigned inside the closure as well.
(I compiled code from
"http://hg.openjdk.java.net/closures/closures/langtools" and ran
"dist/boostrap/bin/javac -source 1.7".)
More information about the closures-dev