Sorry, I tried posting this to groovy-dev mailing list but it got rejected (even though I successfully subscribed via xircles):
As part of a @Lazy thread-safety discussion, it got me to thinking, "how would you test this?".
As far as I can tell, the tests of ASTTransformations rely on shell.evaluate("""source"""), but that's not going to cut it in the case of the above issue.
I'm assuming at some point you can access the entire AST before it gets "written" and then you could walk the AST tree, but it sure seems like that would lead to some very brittle tests (you wouldn't want every compiler optimization to produce a slew of test failures).
So how ideally would you go about testing similar issues?
In a somewhat related vein, apropos of Jochen's work on invokedynamic support, how is that planning to be integrated in a common codebase that needs to support < 1.7? Will it be an argument to groovyc? or will groovyc rely on runtime detection of java.version? I'm assuming that the bytecode itself will not do runtime detection (on initial thought that would be a nightmare)