File tree Expand file tree Collapse file tree 1 file changed +24
-13
lines changed Expand file tree Collapse file tree 1 file changed +24
-13
lines changed Original file line number Diff line number Diff line change @@ -3353,19 +3353,30 @@ class ArgumentMatcher : public MatchCallArgumentListener {
3353
3353
}
3354
3354
3355
3355
bool isPropertyWrapperImplicitInit () {
3356
- if (auto TE = dyn_cast<TypeExpr>(FnExpr)) {
3357
- if (TE->getInstanceType ()
3358
- ->getAnyNominal ()
3359
- ->getAttrs ()
3360
- .hasAttribute <PropertyWrapperAttr>()) {
3361
- if (auto parent = CandidateInfo.CS .getParentExpr (FnExpr)) {
3362
- if (auto CE = dyn_cast<CallExpr>(parent)) {
3363
- return CE->isImplicit ();
3364
- }
3365
- }
3366
- }
3367
- }
3368
- return false ;
3356
+ auto TE = dyn_cast<TypeExpr>(FnExpr);
3357
+ if (!TE)
3358
+ return false ;
3359
+
3360
+ auto instanceTy = TE->getInstanceType ();
3361
+ if (!instanceTy)
3362
+ return false ;
3363
+
3364
+ auto nominalDecl = instanceTy->getAnyNominal ();
3365
+ if (!nominalDecl)
3366
+ return false ;
3367
+
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 ;
3378
+
3379
+ return CE->isImplicit ();
3369
3380
}
3370
3381
3371
3382
bool missingLabel (unsigned paramIdx) override {
You can’t perform that action at this time.
0 commit comments