Fix two regressions on the validation tests. We're passing down default arg info when

parsing curried arguments in some cases, even though that makes no sense.  This will get
cleaned up when they are removed.
This commit is contained in:
Chris Lattner
2016-01-23 09:20:07 -08:00
parent df9bd8a529
commit 28b71e18b3

View File

@@ -107,10 +107,13 @@ static ParserStatus parseDefaultArgument(Parser &P,
break;
}
assert((diagID.ID != DiagID()) == !defaultArgs &&
assert(((diagID.ID != DiagID()) == !defaultArgs ||
// Sometimes curried method parameter lists get default arg info.
// Remove this when they go away.
paramContext == Parser::ParameterContextKind::Curried) &&
"Default arguments specified for an unexpected parameter list kind");
if (!defaultArgs) {
if (diagID.ID != DiagID()) {
auto inFlight = P.diagnose(equalLoc, diagID);
if (initR.isNonNull())
inFlight.fixItRemove(SourceRange(equalLoc, initR.get()->getEndLoc()));