use of org.eclipse.xtext.xbase.validation.ImplicitReturnFinder.Acceptor in project xtext-xtend by eclipse.
the class XtendValidator method checkImplicitReturn.
@Check
protected void checkImplicitReturn(final XtendFunction method) {
if (isIgnored(IMPLICIT_RETURN))
return;
JvmOperation jvmOperation = associations.getDirectlyInferredOperation(method);
IResolvedTypes types = batchTypeResolver.resolveTypes(method);
if (jvmOperation != null && types.getActualType(jvmOperation).isPrimitiveVoid())
return;
implicitReturnFinder.findImplicitReturns(method.getExpression(), new Acceptor() {
@Override
public void accept(XExpression implicitReturn) {
if (method.getExpression() == implicitReturn)
return;
addIssue("Implicit return", implicitReturn, IMPLICIT_RETURN);
}
});
}
Aggregations