I'm 100% sure a syntax like that has been discussed in the past, and discarded for different reasons:
1. consistency between using annotations and a type-checking only feature 2. what about polymorphic closures (aka closures which accept different kind of arguments) 3. the arrow syntax making it hard to read, in particular when the argument types have generics themselves Happy to reopen the discussion, but please keep this in mind. Le mer. 13 févr. 2019 à 09:39, Daniel Sun <realblue...@hotmail.com> a écrit : > Hi Guillaume, > > > What about the various cases, like no-arg closures? > How about `Closure< -> V>` ? > > It is similar to the syntax of closure. More examples: > > 1) > `Closure< String, Number -> Date>` > > is responding to > > ``` > { String x, Number y -> > return new Date() > } > ``` > > 2) > `Closure< -> Date>` > > is responding to > > ``` > { -> > return new Date() > } > ``` > > 3) > `Closure<Date>` means argument generics type information is not available > > Cheers, > Daniel.Sun > > > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html >