groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <>
Subject About polish the generics type syntax for closure
Date Wed, 13 Feb 2019 01:46:47 GMT
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?


Sent from:

View raw message