hg: lambda/lambda/langtools: Add temporary workaround to support intersection-type targets on lambdas method references.

maurizio.cimadamore at oracle.com maurizio.cimadamore at oracle.com
Fri Nov 2 04:46:11 PDT 2012


Changeset: c9a4b3c92810
Author:    mcimadamore
Date:      2012-11-02 11:45 +0000
URL:       http://hg.openjdk.java.net/lambda/lambda/langtools/rev/c9a4b3c92810

Add temporary workaround to support intersection-type targets on lambdas method references.
Type-checking code will now use the _first_ interface bound of an intersection type as the target type for lambdas/method refs.
This allows code using patterns such as:

(Predicate<String> & Serializable)x->false

To compile and behave exactly like before: additional interface bounds are simply ignored.

! src/share/classes/com/sun/tools/javac/comp/Attr.java
+ test/tools/javac/lambda/Intersection01.java
+ test/tools/javac/lambda/Intersection01.out



More information about the lambda-dev mailing list