RFR: JDK-8211148: javac -source 10 in JDK11 is inconsistent with javac in JDK10

Vicente Romero vicente.romero at oracle.com
Wed Oct 3 00:40:56 UTC 2018


Hi,

Please review the fix for [1] at [2]. There were a number of places 
where the compiler was not checking if var syntax for implicit lambdas 
was allowed or not. This implied that the JDK11 compiler was accepting 
code with this feature even if the -source 10 option was passed, this 
shouldn't happen. This patch fixes this and issues the: "var not allowed 
here" error message as expected.

Thanks,
Vicente

[1] https://bugs.openjdk.java.net/browse/JDK-8211148
[2] http://cr.openjdk.java.net/~vromero/8211148/webrev.00/jdk.dev.patch


More information about the compiler-dev mailing list