Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 477753 - Erroneous compilation error when using multi-line lambda, ternary, and Collectors.joining()
Summary: Erroneous compilation error when using multi-line lambda, ternary, and Collec...
Status: VERIFIED DUPLICATE of bug 463728
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.5   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: 4.6 M1   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-17 15:31 EDT by Jeremiah Orr CLA
Modified: 2015-12-08 07:19 EST (History)
2 users (show)

See Also:


Attachments
Example source (817 bytes, text/plain)
2015-09-17 15:31 EDT, Jeremiah Orr CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremiah Orr CLA 2015-09-17 15:31:57 EDT
Created attachment 256654 [details]
Example source

If I use Stream.map() with a multi-line block that returns with a ternary, then use collect(Collectors.joining()), I get the following compilation error:

The method collect(Collector<? super Object,A,R>) in the type Stream<Object> is not applicable for the arguments (Collector<CharSequence,capture#1-of ?,String>)

If I eliminate the ternary or use the single-line lambda shortcut syntax, there is no problem.

I get no compilation errors when compiling with javac.
Comment 1 Sasikanth Bharadwaj CLA 2015-09-18 03:18:21 EDT
Works fine on master, possible duplicate of bug 463728. Please try with a more recent 4.6 version and reopen if the issue still occurs.

*** This bug has been marked as a duplicate of bug 463728 ***
Comment 2 Jay Arthanareeswaran CLA 2015-12-08 07:19:35 EST
Verified for 4.6 M4 with build I20151207-2000.