//
if (parameterElts.size() > 0) {
if (parameterElts.get(0).getParameterKind() == ParameterKind.NAMED) {
// Named parameters, consider the names when matching the parameterElts to the overriddenParameterElts
for (int i = 0; i < parameterElts.size(); i++) {
ParameterElementImpl parameterElt = parameterElts.get(i);
EvaluationResultImpl result = parameterElt.getEvaluationResult();
// TODO (jwren) Ignore Object types, see Dart bug 11287
if (isUserDefinedObject(result)) {
continue;
}
String parameterName = parameterElt.getName();
for (int j = 0; j < overriddenParameterElts.size(); j++) {
ParameterElementImpl overriddenParameterElt = overriddenParameterElts.get(j);
String overriddenParameterName = overriddenParameterElt.getName();
if (parameterName != null && parameterName.equals(overriddenParameterName)) {
EvaluationResultImpl overriddenResult = overriddenParameterElt.getEvaluationResult();
if (isUserDefinedObject(overriddenResult)) {
break;
}
if (!result.equalValues(typeProvider, overriddenResult)) {
errorReporter.reportErrorForNode(
StaticWarningCode.INVALID_OVERRIDE_DIFFERENT_DEFAULT_VALUES_NAMED,
formalParameters.get(i),
overriddenExecutable.getEnclosingElement().getDisplayName(),
overriddenExecutable.getDisplayName(),
parameterName);
foundError = true;
}
}
}
}
} else {
// Positional parameters, consider the positions when matching the parameterElts to the overriddenParameterElts
for (int i = 0; i < parameterElts.size() && i < overriddenParameterElts.size(); i++) {
ParameterElementImpl parameterElt = parameterElts.get(i);
EvaluationResultImpl result = parameterElt.getEvaluationResult();
// TODO (jwren) Ignore Object types, see Dart bug 11287
if (isUserDefinedObject(result)) {
continue;
}
ParameterElementImpl overriddenParameterElt = overriddenParameterElts.get(i);
EvaluationResultImpl overriddenResult = overriddenParameterElt.getEvaluationResult();
if (isUserDefinedObject(overriddenResult)) {
continue;
}
if (!result.equalValues(typeProvider, overriddenResult)) {
errorReporter.reportErrorForNode(