Skip to content

Commit ab1f059

Browse files
committed
[CSDiag] Simplify the 'isPropertyWrapperImplicitInit' method a bit
1 parent b36f772 commit ab1f059

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,21 +3362,15 @@ class ArgumentMatcher : public MatchCallArgumentListener {
33623362
return false;
33633363

33643364
auto nominalDecl = instanceTy->getAnyNominal();
3365-
if (!nominalDecl)
3365+
if (!(nominalDecl &&
3366+
nominalDecl->getAttrs().hasAttribute<PropertyWrapperAttr>()))
33663367
return false;
33673368

3368-
if (!nominalDecl->getAttrs().hasAttribute<PropertyWrapperAttr>())
3369-
return false;
3370-
3371-
auto parent = CandidateInfo.CS.getParentExpr(FnExpr);
3372-
if (!parent)
3373-
return false;
3374-
3375-
auto CE = dyn_cast<CallExpr>(parent);
3376-
if (!CE)
3377-
return false;
3369+
if (auto *parentExpr = CandidateInfo.CS.getParentExpr(FnExpr)) {
3370+
return parentExpr->isImplicit() && isa<CallExpr>(parentExpr);
3371+
}
33783372

3379-
return CE->isImplicit();
3373+
return false;
33803374
}
33813375

33823376
bool missingLabel(unsigned paramIdx) override {

0 commit comments

Comments
 (0)