Bug 423129 - [1.8][compiler] Hook up lambda expressions into statement recovery
Summary: [1.8][compiler] Hook up lambda expressions into statement recovery
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact: Sasikanth Bharadwaj CLA
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-12-04 01:47 EST by Srikanth Sankaran CLA
Modified: 2022-10-31 15:59 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2013-12-04 01:47:04 EST
The following program generates an incorrect message about xyz being undefined:

interface I {
	String foo(Integer x);
}

public class X {
	static void goo(String s) {
		
	}
	static void goo(I i) {
		
	}
	public static void main(String[] args) {
		goo((xyz) -> {
			System.out.println(xyz);
			return xyz.
		});
	}
}
Comment 1 Srikanth Sankaran CLA 2013-12-12 00:18:46 EST
Another program showing weird error message is below. Once the extra semicolon
at the bottom is removed, code compiles fine:

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
public class X {
   int compareTo(X x) { return 0; }
	void foo() {
		Collections.sort(new ArrayList<X>(Arrays.asList(new X(), new X(), new X())),
				(X o1, X o2) -> o1.compareTo(o2)); //[2]
	}

	}
}
Comment 2 Srikanth Sankaran CLA 2013-12-18 07:41:26 EST
Released tests for the problematic snippets here: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA8&id=0ac384309d9e7a05eca3c3a40adf81679fddc64b.

The tests encode the present buggy behavior.
Comment 3 Srikanth Sankaran CLA 2014-11-02 21:03:16 EST
I will not be able to finish this. Reassigning to inbox.
Comment 4 Manoj N Palat CLA 2015-04-07 23:25:06 EDT
Lambda recovery deferred to 4.6
Comment 5 Eclipse Genie CLA 2020-08-10 14:22:51 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2022-10-31 15:59:44 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.