File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8359,7 +8359,7 @@ void VarDecl::emitLetToVarNoteIfSimple(DeclContext *UseDC) const {
83598359 auto &d = getASTContext ().Diags ;
83608360 auto descriptiveKindName = Decl::getDescriptiveKindName (FD->getDescriptiveKind ());
83618361 auto diags = d.diagnose (FD->getFuncLoc (), diag::change_to_mutating,
8362- isa<AccessorDecl>(FD),descriptiveKindName);
8362+ isa<AccessorDecl>(FD), descriptiveKindName);
83638363 if (auto nonmutatingAttr =
83648364 FD->getAttrs ().getAttribute <NonMutatingAttr>()) {
83658365 diags.fixItReplace (nonmutatingAttr->getLocation (), " mutating" );
Original file line number Diff line number Diff line change @@ -1378,7 +1378,9 @@ void AttributeChecker::visitObjCAttr(ObjCAttr *attr) {
13781378 error = diag::invalid_objc_decl_context;
13791379 else if (auto accessor = dyn_cast<AccessorDecl>(func))
13801380 if (!accessor->isGetterOrSetter ()) {
1381- diagnoseAndRemoveAttr (attr, diag::objc_observing_accessor, accessor->getDescriptiveKind ()).limitBehavior (behavior);
1381+ auto declKind = accessor->getDescriptiveKind ();
1382+ diagnoseAndRemoveAttr (attr, diag::objc_observing_accessor, declKind)
1383+ .limitBehavior (behavior);
13821384 reason.describe (D);
13831385 return ;
13841386 }
@@ -2538,11 +2540,8 @@ void AttributeChecker::visitFinalAttr(FinalAttr *attr) {
25382540
25392541 if (auto *accessor = dyn_cast<AccessorDecl>(D)) {
25402542 if (!attr->isImplicit ()) {
2541- bool isProperty = false ;
2542- if (auto *VD = dyn_cast<VarDecl>(accessor->getStorage ()))
2543- isProperty = true ;
25442543 diagnose (attr->getLocation (), diag::final_not_on_accessors,
2545- isProperty )
2544+ isa<VarDecl>(accessor-> getStorage ()) )
25462545 .fixItRemove (attr->getRange ());
25472546 return ;
25482547 }
You can’t perform that action at this time.
0 commit comments