Details
-
Wish
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.4
-
None
-
None
Description
Currently @DelegateTo allows to use the generic type of another argument of the call, but I actually need to delegate to one of the generic parameters of the enclosing class.
I.e. my signature is:
PipelineBuilder<T> map( boolean passThroughNulls = true, @ClosureParams(value=FromString.class, options=["T"]) Closure<T> mapper )
And I want the mapper closure to be able to refer to the payload through the delegate as well as the 'it' parameter.
Unfortunately @DelegatesTo won't let me do this as it was written prior
to @ClosureParams and it does not support things like FirstParam or FromString...
Aligning the config params of @DeleatesTo and @ClosureParams, will make them more powerful and easier to learn.