Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.3.4
-
None
Description
If @DelegatesTo tells that the delegate is a Java class (which doesn't implement GroovyObject), then the static compiler generates wrong bytecode, like in the following example:
class MyHandlers { def handler(@DelegatesTo(GroovyContext) Closure<?> c) { def l = new GroovyContext() c.delegate = l c.call() } def execute() { handler { request.headers.bar } } }
Issue highlighted in Ratpack, responsible for the joint build failure. See https://github.com/ratpack/ratpack/pull/375#issuecomment-49249705