groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paolo Di Tommaso <paolo.ditomm...@gmail.com>
Subject Re: About polish the generics type syntax for closure
Date Wed, 13 Feb 2019 06:37:14 GMT
Nice!

On Wed, Feb 13, 2019 at 2:50 AM Daniel Sun <realbluesun@hotmail.com> wrote:

> Hi all
>
>        I've been developing a project with Groovy 3. When I try to specify
> the generics type for closure, I have to use annotation..., which is quite
> verbose... e.g.
> ```
> public <V> V withSql(@ClosureParams(value= SimpleType.class,
> options="groovy.sql.Sql") Closure<V> closure)
> ```
>
>        I propose make the above code groovier, e.g.
> ```
> public <V> V withSql(Closure<groovy.sql.Sql -> V> closure)
> ```
>
>        Any thoughts?
>
>
> Cheers,
> Daniel.Sun
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>

Mime
View raw message