Introduce Covariance/Contravariance at declaration site for Java 9 ?
Joshua Bloch
josh at bloch.us
Mon Oct 15 17:24:52 PDT 2012
I believe that declaration site variance annotations are every bit as bad
as use-site annotations. They're bad in a different way--they force you to
write idiosyncratic types because natural types don't lend themselves to
fixed variance restrictions--but they're still bad. Providing both use and
declaration site variance in one language is the worst of both worlds
(unless you're trying to kill the language).
Josh
On Mon, Oct 15, 2012 at 3:09 PM, Remi Forax <forax at univ-mlv.fr> wrote:
> I've just read the presentation of Stuart Marks at JavaOne [1],
> all examples after slide 32, the first one that use lambdas are not
> written correctly
> because all method signatures do not use wildcards.
>
> Brian, I know that we will not be able to introduce
> covariance/contravariance
> at declaration site for Java 8, so the solution we will deliver will be
> far from perfect
> because nobody understand wildcards.
> Is there a way to free Dan and Maurizio enough time to investigate if
> covariance/contravariance can be added to Java 9.
>
> Rémi
> [1] https://stuartmarks.wordpress.**com/2012/10/07/javaone-2012-**
> jump-starting-lambda-**programming/<https://stuartmarks.wordpress.com/2012/10/07/javaone-2012-jump-starting-lambda-programming/>
>
>
More information about the lambda-libs-spec-observers
mailing list