Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 383046

Summary: [1.8][compiler] Error getting reported on the lambda expression if there is a subsequent parse error
Product: [Eclipse Project] JDT Reporter: Satyam Kandula <satyam.kandula>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: srikanth_sankaran
Version: 3.8   
Target Milestone: BETA J8   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481133
Whiteboard:

Description Satyam Kandula CLA 2012-06-20 01:43:55 EDT
###
interface IX{
	public void foo();
}
public class X {
	 IX i = () -> 42;
	 int
}
###
In this test case, there is an expected error at the incomplete int. However, there is also an error on the correct lambda expression.
Comment 1 Srikanth Sankaran CLA 2012-06-20 11:46:26 EDT
The reported problem has been fixed via:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=6a1671aa7ea88fc01c83297c32d40152115e2623

and a similar problem with method references fixed via:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=05c0ef920f8f629670a61fe160e2d7350d9d88d5

The current set of fixes address the correctness issue. There is
still some room for performance improvement. So I'll leave the
current bug open, but will adjust its blocking status.
Comment 2 Srikanth Sankaran CLA 2012-07-04 23:28:41 EDT
Experiments reported at https://bugs.eclipse.org/bugs/show_bug.cgi?id=383378#c11
and https://bugs.eclipse.org/bugs/show_bug.cgi?id=383378#c13 indicate that
running the scanner in a always look ahead at '(' or '<' mode does not entail
any mentionworthy performance loss. In any case since bug 383378 tracks the
performance of scanner/parser changes, I'll close the current bug as is adding
a note in bug 383378 that any fix adopted should also work well for DiagnoseParser.