@@ -6916,9 +6916,8 @@ bool Parser::parseMemberDeclList(SourceLoc &LBLoc, SourceLoc &RBLoc,
69166916 IDC->setMaybeHasDerivativeDeclarations ();
69176917
69186918 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});
69226921
69236922 // Cache the empty result to prevent delayed parsing.
69246923 Context.evaluator .cacheOutput (ParseMembersRequest{IDC},
@@ -8299,9 +8298,8 @@ Parser::parseDeclVarGetSet(PatternBindingEntry &entry, ParseDeclOptions Flags,
82998298
83008299 // Reject accessors when we're parsing stubs only.
83018300 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 });
83058303 Invalid = true ;
83068304 }
83078305
@@ -9027,9 +9025,8 @@ void Parser::parseAbstractFunctionBody(AbstractFunctionDecl *AFD,
90279025 setIDEInspectionDelayedDeclStateIfNeeded ();
90289026
90299027 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);
90339030 AFD->setBody (nullptr , AbstractFunctionDecl::BodyKind::None);
90349031 }
90359032}
0 commit comments