mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Replace calls to OverloadChoice constructor with two overloads of getDecl()
This commit is contained in:
@@ -10491,8 +10491,8 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
|
||||
auto choice =
|
||||
instanceTy->isAnyObject()
|
||||
? candidate
|
||||
: OverloadChoice(instanceTy, decl,
|
||||
FunctionRefInfo::singleBaseNameApply());
|
||||
: OverloadChoice::getDecl(instanceTy, decl,
|
||||
FunctionRefInfo::singleBaseNameApply());
|
||||
|
||||
const bool invalidMethodRef = isa<FuncDecl>(decl) && !hasInstanceMethods;
|
||||
const bool invalidMemberRef = !isa<FuncDecl>(decl) && !hasInstanceMembers;
|
||||
@@ -10727,7 +10727,7 @@ performMemberLookup(ConstraintKind constraintKind, DeclNameRef memberName,
|
||||
}
|
||||
}
|
||||
|
||||
return OverloadChoice(baseTy, cand, functionRefInfo);
|
||||
return OverloadChoice::getDecl(baseTy, cand, functionRefInfo);
|
||||
};
|
||||
|
||||
// Add all results from this lookup.
|
||||
@@ -11866,7 +11866,8 @@ ConstraintSystem::simplifyValueWitnessConstraint(
|
||||
if (!witness)
|
||||
return fail();
|
||||
|
||||
auto choice = OverloadChoice(resolvedBaseType, witness.getDecl(), functionRefInfo);
|
||||
auto choice = OverloadChoice::getDecl(
|
||||
resolvedBaseType, witness.getDecl(), functionRefInfo);
|
||||
addBindOverloadConstraint(memberType, choice, getConstraintLocator(locator),
|
||||
useDC);
|
||||
return SolutionKind::Solved;
|
||||
@@ -14110,8 +14111,8 @@ ConstraintSystem::simplifyDynamicCallableApplicableFnConstraint(
|
||||
SmallVector<OverloadChoice, 4> choices;
|
||||
for (auto candidate : candidates) {
|
||||
if (candidate->isInvalid()) continue;
|
||||
choices.push_back(OverloadChoice(type2, candidate,
|
||||
FunctionRefInfo::singleBaseNameApply()));
|
||||
choices.push_back(OverloadChoice::getDecl(type2, candidate,
|
||||
FunctionRefInfo::singleBaseNameApply()));
|
||||
}
|
||||
|
||||
if (choices.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user