GROOVY-6114: Immutable AST transformation may generate invalid bytecode ...

...in combination with @CompileStatic

Suggested fix for GROOVY-6114 and GROOVY-6119