protected boolean isPossibleFunctionType(int idx) {
		if (idx < arguments.getArgumentCount()) {
			XExpression argument = arguments.getArgument(idx);
			if (argument instanceof XClosure) {
				XClosure closure = (XClosure) argument;
				LightweightTypeReference declaredType = arguments.getDeclaredTypeForLambda(idx);
				if (declaredType != null && !declaredType.isType(Object.class)) {
					CommonTypeComputationServices services = getState().getReferenceOwner().getServices();
					JvmOperation operation = services.getFunctionTypes().findImplementingOperation(declaredType);
					if (operation == null) {
						return false;
					}
					if (closure.isExplicitSyntax() && closure.getDeclaredFormalParameters().size() != operation.getParameters().size()) {
						return false;
					}
				}
			}
		}
		return true;
	}
protected boolean isPossibleFunctionType ( int idx ) { if ( idx < arguments . getArgumentCount ( ) ) { XExpression argument = arguments . getArgument ( idx ) ; if ( argument instanceof XClosure ) { XClosure closure = ( XClosure ) argument ; LightweightTypeReference declaredType = arguments . getDeclaredTypeForLambda ( idx ) ; if ( declaredType != null && ! declaredType . isType ( Object . class ) ) { CommonTypeComputationServices services = getState ( ) . getReferenceOwner ( ) . getServices ( ) ; JvmOperation operation = services . getFunctionTypes ( ) . findImplementingOperation ( declaredType ) ; if ( operation == null ) { return false ; } if ( closure . isExplicitSyntax ( ) && closure . getDeclaredFormalParameters ( ) . size ( ) != operation . getParameters ( ) . size ( ) ) { return false ; } } } } return true ; }
Returns false if the argument expression is a lambda and the expected type
of the argument is not a function type or {@link Object}.
Returns true in all other cases.

This serves as a shortcut to rule out decision path's where a method is overloaded
and one of the overloads accepts a function type but the other doesn't. In those cases
it is not necessary to compute the type of the lamdba expression twice.

An example for this pattern is {@link IterableExtensions#filter(Iterable, Class)} vs
{@link IterableExtensions#filter(Iterable, org.eclipse.xtext.xbase.lib.Functions.Function1)}.