Skip to content

Commit 5b1f42c

Browse files
committed
Generalize some code to be based on SelfApplyExpr instead of its two
derived classes, NFC.
1 parent a3f3a76 commit 5b1f42c

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -395,21 +395,15 @@ ResolvedLocator constraints::resolveLocatorToDecl(
395395
continue;
396396
}
397397

398-
if (auto constructor = dyn_cast<ConstructorRefCallExpr>(anchor)) {
399-
anchor = constructor->getFn();
398+
if (auto selfApply = dyn_cast<SelfApplyExpr>(anchor)) {
399+
anchor = selfApply->getFn();
400400
continue;
401401
}
402402

403403
if (auto dotSyntax = dyn_cast<DotSyntaxBaseIgnoredExpr>(anchor)) {
404404
anchor = dotSyntax->getRHS();
405405
continue;
406406
}
407-
408-
if (auto dotSyntax = dyn_cast<DotSyntaxCallExpr>(anchor)) {
409-
anchor = dotSyntax->getFn();
410-
continue;
411-
}
412-
413407
break;
414408
} while (true);
415409

@@ -1506,9 +1500,7 @@ void CalleeCandidateInfo::collectCalleeCandidates(Expr *fn) {
15061500
// If we have a type for that, capture it so that we can calculate a
15071501
// substituted type, which resolves many generic arguments.
15081502
Type baseType;
1509-
1510-
// TODO: What about ConstructorRefCallExpr?
1511-
if (isa<DotSyntaxCallExpr>(AE) &&
1503+
if (isa<SelfApplyExpr>(AE) &&
15121504
!isUnresolvedOrTypeVarType(AE->getArg()->getType()))
15131505
baseType = AE->getArg()->getType()->getLValueOrInOutObjectType();
15141506

0 commit comments

Comments
 (0)