When the lambdas are nested the lambda recovery on the statement which
has the lambda under completion, the CompletionNode ends up in the outer
lambda. Here we loose the most of the context due to this. The reason in
when there is not semicolon the consumeExpressionStatement is not
executed which is responsible for pushing the expression which contains
the completing lambda into ASTStack.
The fix tries identify the nested lambda situation when handling lambda
closure recovery and simulate the same behavior which is triggered when
processing block statements which cause the correct expression to push
into ASTStack.
Change-Id: Iad6ae5c0a33b106d5f96f7297c8954322e08b64e
Signed-off-by: Gayan Perera <gayanper@gmail.com>
Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/188986
Tested-by: JDT Bot <jdt-bot@eclipse.org>
Reviewed-by: Jay Arthanareeswaran <jarthana@in.ibm.com>
Reviewed-by: Stephan Herrmann <stephan.herrmann@berlin.de>