RFR JDK-8205052: No compilation error thrown when no valid parameterization exists for functional interface type

Vicente Romero vicente.romero at oracle.com
Tue Jun 19 02:53:29 UTC 2018


Hi,

Please review the fix for bug [1], the fix can be found at [2]. 
Basically the fix for [3] modified javac so that it could use 
intersection types as the target type of functional expressions during 
type attribution. Some code paths were not prepared to deal with 
intersections. This patch is fixing 
Types.DescriptorCache.FunctionDescriptor::getType which also checks for 
the well formed-ness of the target type. The proposed fix is to split 
the intersection into its components and check for the well formed-ness 
of every component. Regarding the proposed error message there are two 
options it can refer to the whole intersection type, which is what this 
patch is doing, or to the particular component that is not well formed. 
I'm OK with either.

Thanks,
Vicente

PS, thanks to Maurizio for an analysis of the possible solutions to this 
issue

[1] https://bugs.openjdk.java.net/browse/JDK-8205052
[2] http://cr.openjdk.java.net/~vromero/8205052/webrev.00/
[3] https://bugs.openjdk.java.net/browse/8148354


More information about the compiler-dev mailing list