On 22 March 2013 09:09, Luke Daley <[email protected]> wrote:
> Hi,
>
> DomainObjectCollection<T> {
> <S extends T> DomainObjectCollection<S> withType(Class<S>) {}
> }
>
> This generic signature is not right. It doesn't allow creating a filtered
> set by an interface. My use case was…
>
> tasks.withType(JavaForkOptions) {
>
> }
>
> But this doesn't work.
>
> Do we want to fix this? If so, how the hell do we do so in a backwards
> compatible way?
>
We can just remove the `extends T` bound on `S`. It's source and binary
backwards-compatible.
--
Adam Murdoch
Gradle Co-founder
http://www.gradle.org
VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting
http://www.gradleware.com
Join us at the Gradle Summit 2013, June 13th and 14th in Santa Clara, CA:
http://www.gradlesummit.com