Hi,
I raised this Jira ticket: https://issues.apache.org/jira/browse/GROOVY-10876
could you please confirm this is a bug? This also happens with the new 4.0.7 release.
The simple testcase I posted in the ticket should describe the problem, but let me know if you need more information.
Regards,
Eduardo