Skip to content

Commit 0e6dc0c

Browse files
committed
[Gardening] getAttribute -> hasAttribute
1 parent d2360d2 commit 0e6dc0c

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/Sema/TypeCheckDeclObjC.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,7 @@ Optional<ObjCReason> shouldMarkAsObjC(const ValueDecl *VD, bool allowImplicit) {
10431043

10441044
// Infer @objc for @_dynamicReplacement(for:) when replaced decl is @objc.
10451045
if (isa<AbstractFunctionDecl>(VD) || isa<AbstractStorageDecl>(VD))
1046-
if (auto *replacementAttr =
1047-
VD->getAttrs().getAttribute<DynamicReplacementAttr>()) {
1046+
if (VD->getAttrs().hasAttribute<DynamicReplacementAttr>()) {
10481047
if (auto *replaced = VD->getDynamicallyReplacedDecl()) {
10491048
if (replaced->isObjC())
10501049
return ObjCReason(ObjCReason::ImplicitlyObjC);

lib/Sema/TypeCheckPropertyWrapper.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,8 @@ AttachedPropertyWrappersRequest::evaluate(Evaluator &evaluator,
461461
}
462462

463463
// Properties with wrappers must not override another property.
464-
if (auto classDecl = dyn_cast<ClassDecl>(dc)) {
465-
if (auto overrideAttr = var->getAttrs().getAttribute<OverrideAttr>()) {
466464
if (isa<ClassDecl>(dc)) {
465+
if (var->getAttrs().hasAttribute<OverrideAttr>()) {
467466
var->diagnose(diag::property_with_wrapper_overrides,
468467
var->getFullName())
469468
.highlight(attr->getRange());

0 commit comments

Comments
 (0)