@@ -6916,9 +6916,8 @@ bool Parser::parseMemberDeclList(SourceLoc &LBLoc, SourceLoc &RBLoc,
6916
6916
IDC->setMaybeHasDerivativeDeclarations ();
6917
6917
6918
6918
if (Flags.contains (PD_StubOnly)) {
6919
- diagnose (LBLoc, diag::stub_decl_cannot_have_body,
6920
- IDC->getDecl ()->getDescriptiveKind ())
6921
- .fixItRemove ({LBLoc, RBLoc});
6919
+ diagnose (LBLoc, diag::stub_decl_cannot_have_body, IDC->getDecl ())
6920
+ .fixItRemove ({LBLoc, RBLoc});
6922
6921
6923
6922
// Cache the empty result to prevent delayed parsing.
6924
6923
Context.evaluator .cacheOutput (ParseMembersRequest{IDC},
@@ -8299,9 +8298,8 @@ Parser::parseDeclVarGetSet(PatternBindingEntry &entry, ParseDeclOptions Flags,
8299
8298
8300
8299
// Reject accessors when we're parsing stubs only.
8301
8300
if (Flags.contains (PD_StubOnly) && !accessors.Accessors .empty ()) {
8302
- diagnose (Tok, diag::stub_decl_cannot_have_body,
8303
- PrimaryVar->getDescriptiveKind ())
8304
- .fixItRemove ({ accessors.LBLoc , accessors.RBLoc });
8301
+ diagnose (Tok, diag::stub_decl_cannot_have_body, PrimaryVar)
8302
+ .fixItRemove ({accessors.LBLoc , accessors.RBLoc });
8305
8303
Invalid = true ;
8306
8304
}
8307
8305
@@ -9027,9 +9025,8 @@ void Parser::parseAbstractFunctionBody(AbstractFunctionDecl *AFD,
9027
9025
setIDEInspectionDelayedDeclStateIfNeeded ();
9028
9026
9029
9027
if (Flags.contains (PD_StubOnly)) {
9030
- diagnose (BodyRange.Start , diag::stub_decl_cannot_have_body,
9031
- AFD->getDescriptiveKind ())
9032
- .fixItRemove (BodyRange);
9028
+ diagnose (BodyRange.Start , diag::stub_decl_cannot_have_body, AFD)
9029
+ .fixItRemove (BodyRange);
9033
9030
AFD->setBody (nullptr , AbstractFunctionDecl::BodyKind::None);
9034
9031
}
9035
9032
}
0 commit comments