Skip to content

Commit 0aadb7c

Browse files
committed
[CSDiag] NFC: Move findResolvedMemberRef to ConstraintSystem.cpp
This method is used by diagnostics and CSApply at this point.
1 parent faf3be4 commit 0aadb7c

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2303,19 +2303,3 @@ void FailureDiagnosis::diagnoseAmbiguity(Expr *E) {
23032303
diagnose(E->getLoc(), diag::type_of_expression_is_ambiguous)
23042304
.highlight(E->getSourceRange());
23052305
}
2306-
2307-
/// If an UnresolvedDotExpr, SubscriptMember, etc has been resolved by the
2308-
/// constraint system, return the decl that it references.
2309-
ValueDecl *ConstraintSystem::findResolvedMemberRef(ConstraintLocator *locator) {
2310-
// See if we have a resolution for this member.
2311-
auto overload = findSelectedOverloadFor(locator);
2312-
if (!overload)
2313-
return nullptr;
2314-
2315-
// We only want to handle the simplest decl binding.
2316-
auto choice = overload->choice;
2317-
if (choice.getKind() != OverloadChoiceKind::Decl)
2318-
return nullptr;
2319-
2320-
return choice.getDecl();
2321-
}

lib/Sema/ConstraintSystem.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3940,3 +3940,19 @@ Expr *ConstraintSystem::buildAutoClosureExpr(Expr *expr,
39403940
cacheExprTypes(result);
39413941
return result;
39423942
}
3943+
3944+
/// If an UnresolvedDotExpr, SubscriptMember, etc has been resolved by the
3945+
/// constraint system, return the decl that it references.
3946+
ValueDecl *ConstraintSystem::findResolvedMemberRef(ConstraintLocator *locator) {
3947+
// See if we have a resolution for this member.
3948+
auto overload = findSelectedOverloadFor(locator);
3949+
if (!overload)
3950+
return nullptr;
3951+
3952+
// We only want to handle the simplest decl binding.
3953+
auto choice = overload->choice;
3954+
if (choice.getKind() != OverloadChoiceKind::Decl)
3955+
return nullptr;
3956+
3957+
return choice.getDecl();
3958+
}

0 commit comments

Comments
 (0)