mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user