@@ -187,8 +187,7 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
187
187
if (!hasSpecifier) {
188
188
if (Tok.is (tok::kw_let)) {
189
189
diagnose (Tok, diag::parameter_let_as_attr)
190
- .fixItRemove (Tok.getLoc ());
191
- param.isInvalid = true ;
190
+ .fixItRemove (Tok.getLoc ());
192
191
} else {
193
192
// We handle the var error in sema for a better fixit and inout is
194
193
// handled later in this function for better fixits.
@@ -201,9 +200,8 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
201
200
// Redundant specifiers are fairly common, recognize, reject, and recover
202
201
// from this gracefully.
203
202
diagnose (Tok, diag::parameter_inout_var_let_repeated)
204
- .fixItRemove (Tok.getLoc ());
203
+ .fixItRemove (Tok.getLoc ());
205
204
consumeToken ();
206
- param.isInvalid = true ;
207
205
}
208
206
}
209
207
@@ -252,9 +250,8 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
252
250
hasValidInOut = true ;
253
251
if (hasSpecifier) {
254
252
diagnose (Tok.getLoc (), diag::parameter_inout_var_let_repeated)
255
- .fixItRemove (param.LetVarInOutLoc );
253
+ .fixItRemove (param.LetVarInOutLoc );
256
254
consumeToken (tok::kw_inout);
257
- param.isInvalid = true ;
258
255
} else {
259
256
hasSpecifier = true ;
260
257
param.LetVarInOutLoc = consumeToken (tok::kw_inout);
@@ -263,9 +260,8 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
263
260
}
264
261
if (!hasValidInOut && hasDeprecatedInOut) {
265
262
diagnose (Tok.getLoc (), diag::inout_as_attr_disallowed)
266
- .fixItRemove (param.LetVarInOutLoc )
267
- .fixItInsert (postColonLoc, " inout " );
268
- param.isInvalid = true ;
263
+ .fixItRemove (param.LetVarInOutLoc )
264
+ .fixItInsert (postColonLoc, " inout " );
269
265
}
270
266
271
267
auto type = parseType (diag::expected_parameter_type);
@@ -322,14 +318,13 @@ Parser::parseParameterClause(SourceLoc &leftParenLoc,
322
318
if (param.Type ) {
323
319
diagnose (typeStartLoc, diag::parameter_unnamed)
324
320
.fixItInsert (typeStartLoc, " _: " );
325
- } else {
326
- param.isInvalid = true ;
327
321
}
328
322
} else {
329
323
// Otherwise, we're not sure what is going on, but this doesn't smell
330
324
// like a parameter.
331
325
diagnose (Tok, diag::expected_parameter_name);
332
326
param.isInvalid = true ;
327
+ param.FirstNameLoc = Tok.getLoc ();
333
328
}
334
329
}
335
330
0 commit comments