File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -1019,13 +1019,11 @@ static void checkDefaultArguments(ParameterList *params) {
1019
1019
// Placeholder types are banned for all parameter decls. We try to use the
1020
1020
// freshly-checked default expression's contextual type to suggest a
1021
1021
// reasonable type to insert.
1022
+ param->diagnose (diag::placeholder_type_not_allowed_in_parameter)
1023
+ .highlight (param->getSourceRange ());
1022
1024
if (expr && !expr->getType ()->hasError ()) {
1023
- param->diagnose (diag::placeholder_type_not_allowed_in_parameter)
1024
- .highlight (param->getSourceRange ());
1025
1025
TypeChecker::notePlaceholderReplacementTypes (
1026
1026
ifacety, expr->getType ()->mapTypeOutOfContext ());
1027
- } else {
1028
- param->diagnose (diag::placeholder_type_not_allowed);
1029
1027
}
1030
1028
}
1031
1029
}
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ func opaque() -> some _ { // expected-error {{type placeholder not allowed here}
249
249
}
250
250
251
251
enum EnumWithPlaceholders {
252
- case topLevelPlaceholder( x: _ ) // expected-error {{type placeholder not allowed here }}
252
+ case topLevelPlaceholder( x: _ ) // expected-error {{type placeholder may not appear in top-level parameter }}
253
253
case placeholderWithDefault( x: _ = 5 ) // expected-error {{type placeholder may not appear in top-level parameter}}
254
254
// expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
255
255
}
You can’t perform that action at this time.
0 commit comments