mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSDiag] NFC: Move findResolvedMemberRef to ConstraintSystem.cpp
This method is used by diagnostics and CSApply at this point.
This commit is contained in:
@@ -3940,3 +3940,19 @@ Expr *ConstraintSystem::buildAutoClosureExpr(Expr *expr,
|
||||
cacheExprTypes(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
/// If an UnresolvedDotExpr, SubscriptMember, etc has been resolved by the
|
||||
/// constraint system, return the decl that it references.
|
||||
ValueDecl *ConstraintSystem::findResolvedMemberRef(ConstraintLocator *locator) {
|
||||
// See if we have a resolution for this member.
|
||||
auto overload = findSelectedOverloadFor(locator);
|
||||
if (!overload)
|
||||
return nullptr;
|
||||
|
||||
// We only want to handle the simplest decl binding.
|
||||
auto choice = overload->choice;
|
||||
if (choice.getKind() != OverloadChoiceKind::Decl)
|
||||
return nullptr;
|
||||
|
||||
return choice.getDecl();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user