Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 544217 - Compile error for java 11 syntax
Summary: Compile error for java 11 syntax
Status: CLOSED DUPLICATE of bug 541532
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.11   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: 4.11 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-07 06:11 EST by Robert Sermak CLA
Modified: 2019-02-07 07:15 EST (History)
1 user (show)

See Also:


Attachments
project containing problematic case (5.36 KB, application/x-zip-compressed)
2019-02-07 06:11 EST, Robert Sermak CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Sermak CLA 2019-02-07 06:11:41 EST
Created attachment 277488 [details]
project containing problematic case

environment: Oracle Java 11.0.2, Eclipse 4.11.M1, Windows 10

steps to reproduce:

-import attached project java11.zip 
-open class VarInLambda and see that there is a compile error on construction:
        ArrayList<String> list = new ArrayList<>();
        list.stream()
                .map((var s) -> s.toLowerCase())
                .collect(Collectors.toList());

saying:
The method map(Function<? super String,? extends R>) in the type Stream<String> is not applicable for the arguments ((var s) -> {})

The code compiles without errors under Java 11 javac.
If we replace 'var s' with 'String s' everything works fine.
Comment 1 Stephan Herrmann CLA 2019-02-07 07:15:55 EST
Thanks for the report.
Fortunately we just fixed this on 2019-01-23 via bug 541532.

*** This bug has been marked as a duplicate of bug 541532 ***