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) {
10191019 // Placeholder types are banned for all parameter decls. We try to use the
10201020 // freshly-checked default expression's contextual type to suggest a
10211021 // reasonable type to insert.
1022+ param->diagnose (diag::placeholder_type_not_allowed_in_parameter)
1023+ .highlight (param->getSourceRange ());
10221024 if (expr && !expr->getType ()->hasError ()) {
1023- param->diagnose (diag::placeholder_type_not_allowed_in_parameter)
1024- .highlight (param->getSourceRange ());
10251025 TypeChecker::notePlaceholderReplacementTypes (
10261026 ifacety, expr->getType ()->mapTypeOutOfContext ());
1027- } else {
1028- param->diagnose (diag::placeholder_type_not_allowed);
10291027 }
10301028 }
10311029}
Original file line number Diff line number Diff line change @@ -249,7 +249,7 @@ func opaque() -> some _ { // expected-error {{type placeholder not allowed here}
249249}
250250
251251enum 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 }}
253253 case placeholderWithDefault( x: _ = 5 ) // expected-error {{type placeholder may not appear in top-level parameter}}
254254 // expected-note@-1 {{replace the placeholder with the correct type 'Int'}}
255255}
You can’t perform that action at this time.
0 commit comments