Statement body = lambda.body();
if (body instanceof Expression) {
variables.addAll(new ConstraintExpressionFormula((Expression) body, r, COMPATIBLE).inputVariables(context));
} else {
// TODO: should I use LambdaExpression.resultExpressions? (is currently private).
body.traverse(new ASTVisitor() {
public boolean visit(ReturnStatement returnStatement, BlockScope scope) {
variables.addAll(new ConstraintExpressionFormula(returnStatement.expression, r, COMPATIBLE).inputVariables(context));
return false;
}
}, (BlockScope)null);