groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <realblue...@hotmail.com>
Subject Re: About polish the generics type syntax for closure
Date Wed, 13 Feb 2019 08:36:06 GMT
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

Mime
View raw message