Tested on Oracle JDK 11 and latest (as of now) available version of IntelliJ IDEa (IntelliJ IDEA 2018.2.4). Project language level is Java 11.
Code
public static void main(String[] args) {
System.out.println(List.of("AAA", "BBB", "CCC")
.stream()
.map((@NonNull var s) -> s.toLowerCase())
.collect(Collectors.toList()));
}
Output
[aaa, bbb, ccc]
Everything compiles and runs fine, but editor shows compile-time error:
Is JEP-323 (Local-Variable Syntax for Lambda Parameters) not yet supported or it's a bug?
If you have this error, you most likely have the Lombok plugin installed. It is a Lombok plugin inspection bug.
Disabling the following inspection will fix the problem:
File | Settings | Editor | Probable bugs | Lombok annotations inspection
Also inspection can be implicitly suppressed.
The issue in Lombok-intellij-plugin project has been created:
https://github.com/mplushnikov/lombok-intellij-plugin/issues/531