I've been asking about the same thing back in 2020 with some proposals,
but unfortunately without any reply:
https://mail-archives.apache.org/mod_mbox/groovy-users/202001.mbox/%3cb62eefce-5d71-f394-8024-f2dd93c12...@wp.pl%3e

Nevertheless, maybe this time something constructive will be determined.

Marcin


On 2021-08-04 22:00, Leonard Brünings wrote:
> It is possible to define Closures for annotations, e.g., Spock's
> `@Requires({ os.windows })`.
> However, it is currently impossible to tell the IDE what this annotation
> will delegate to, as @DelegatesTo is only applicable for parameters.
> 
> Could we either allow @DelegatesTo for TYPE_USE or mabe add a new
> dedicated annotation for that.
> 
> public @interface Requires {
>   Class<DelegatesTo(PreconditionContext.class) ? extends Closure> value();
> }
> 
> Alternatively, we could add METHOD as target, to the annotation.
> 
> public @interface Requires {
>   DelegatesTo(PreconditionContext.class)
>   Class<? extends Closure> value();
> }
> 
> Cheers Leonard
> 


-- 
https://blog.solidsoft.pl/ - Working code is not enough

Reply via email to