Skip to content

Commit c219af0

Browse files
committed
[Diagnostics] NFC: Rename OverloadCandidate::getUncurried{Function}Type -> OverloadCandidate::get{Function}Type
1 parent a0085e1 commit c219af0

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5126,7 +5126,7 @@ bool FailureDiagnosis::diagnoseSubscriptMisuse(ApplyExpr *callExpr) {
51265126
using ClosenessPair = CalleeCandidateInfo::ClosenessResultTy;
51275127

51285128
candidateInfo.filterList([&](OverloadCandidate cand) -> ClosenessPair {
5129-
auto candFuncType = cand.getUncurriedFunctionType();
5129+
auto candFuncType = cand.getFunctionType();
51305130
if (!candFuncType)
51315131
return {CC_GeneralMismatch, {}};
51325132

@@ -5679,7 +5679,7 @@ bool FailureDiagnosis::visitApplyExpr(ApplyExpr *callExpr) {
56795679
return false;
56805680

56815681
auto candidate = calleeInfo[0];
5682-
auto *fnType = candidate.getUncurriedFunctionType();
5682+
auto *fnType = candidate.getFunctionType();
56835683
if (!fnType)
56845684
return false;
56855685

@@ -7228,7 +7228,7 @@ bool FailureDiagnosis::visitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
72287228
// expected result type.
72297229
auto resultTy = candidateInfo[0].getResultType();
72307230
if (!resultTy)
7231-
resultTy = candidateInfo[0].getUncurriedType();
7231+
resultTy = candidateInfo[0].getType();
72327232

72337233
if (resultTy && !CS.getContextualType()->is<UnboundGenericType>() &&
72347234
!CS.TC.isConvertibleTo(resultTy, CS.getContextualType(), CS.DC)) {

lib/Sema/CalleeCandidateInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ void OverloadCandidate::dump() const {
143143
llvm::errs() << "<<EXPR>>";
144144
llvm::errs() << " - ignore curried self = " << (skipCurriedSelf ? "yes"
145145
: "no");
146-
147-
if (auto FT = getUncurriedFunctionType())
146+
147+
if (auto FT = getFunctionType())
148148
llvm::errs() << " - type: " << Type(FT) << "\n";
149149
else
150150
llvm::errs() << " - type <<NONFUNCTION>>: " << entityType << "\n";

lib/Sema/CalleeCandidateInfo.h

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ namespace swift {
8181
Expr *getExpr() const {
8282
return declOrExpr.dyn_cast<Expr*>();
8383
}
84-
85-
Type getUncurriedType() const {
84+
85+
Type getType() const {
8686
// Start with the known type of the decl.
8787
auto type = entityType;
8888
if (skipCurriedSelf) {
@@ -92,13 +92,13 @@ namespace swift {
9292
}
9393
return type;
9494
}
95-
96-
AnyFunctionType *getUncurriedFunctionType() const {
97-
if (auto type = getUncurriedType())
95+
96+
AnyFunctionType *getFunctionType() const {
97+
if (auto type = getType())
9898
return type->getAs<AnyFunctionType>();
9999
return nullptr;
100100
}
101-
101+
102102
/// Given a function candidate with an uncurry level, return the parameter
103103
/// type at the specified uncurry level. If there is an error getting to
104104
/// the specified input, this returns a null Type.
@@ -110,20 +110,18 @@ namespace swift {
110110
return FunctionType::composeInput(ctx, params, false);
111111
}
112112

113-
bool hasParameters() const {
114-
return getUncurriedFunctionType();
115-
}
113+
bool hasParameters() const { return getFunctionType(); }
116114

117115
ArrayRef<AnyFunctionType::Param> getParameters() const {
118116
assert(hasParameters());
119-
return getUncurriedFunctionType()->getParams();
117+
return getFunctionType()->getParams();
120118
}
121119

122120
/// Given a function candidate with an uncurry level, return the parameter
123121
/// type at the specified uncurry level. If there is an error getting to
124122
/// the specified input, this returns a null Type.
125123
Type getResultType() const {
126-
if (auto *funcTy = getUncurriedFunctionType())
124+
if (auto *funcTy = getFunctionType())
127125
return funcTy->getResult();
128126
return Type();
129127
}

0 commit comments

Comments
 (0)