for (GoType expressionType : expressionTypes) {
if (returnTypeIndex >= expectedReturnTypes.length) {
result.addProblem(
statement,
GoBundle.message("error.too.many.arguments.to.return"),
new ChangeReturnsParametersFix(statement));
return;
}
if (!expectedReturnTypes[returnTypeIndex].isAssignableFrom(expressionType)) {
result.addProblem(expression,
GoBundle.message("warn.function.return.type.mismatch",
expression.getText(),
GoTypes.getRepresentation(expressionType, currentFile),
GoTypes.getRepresentation(expectedReturnTypes[returnTypeIndex], currentFile)));
}
returnTypeIndex++;
}
}
if (returnTypeIndex < expectedReturnTypes.length)
result.addProblem(statement,
GoBundle.message("error.not.enough.arguments.to.return"),
new ChangeReturnsParametersFix(statement));
}