groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guillaume Laforge <glafo...@gmail.com>
Subject Re: About polish the generics type syntax for closure
Date Wed, 13 Feb 2019 06:39:57 GMT
That's interesting.
What about the various cases, like no-arg closures?

On Wed, Feb 13, 2019 at 7:37 AM Paolo Di Tommaso <paolo.ditommaso@gmail.com>
wrote:

> 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
>>
>

-- 
Guillaume Laforge
Apache Groovy committer
Developer Advocate @ Google Cloud Platform

Blog: http://glaforge.appspot.com/
Twitter: @glaforge <http://twitter.com/glaforge>

Mime
View raw message