@@ -45,19 +45,17 @@ namespace swift {
45
45
CC_GeneralMismatch // /< Something else is wrong.
46
46
};
47
47
48
- // / This is a candidate for a callee, along with an uncurry level .
48
+ // / This is a candidate for a callee.
49
49
// /
50
- // / The uncurry level specifies how far much of a curried value has already
51
- // / been applied. For example, in a funcdecl of:
52
- // / func f(a:Int)(b:Double) -> Int
53
- // / Uncurry level of 0 indicates that we're looking at the "a" argument, an
54
- // / uncurry level of 1 indicates that we're looking at the "b" argument.
50
+ // / `skipCurriedSelf` specifies that function type associated with this
51
+ // / candidate might have a curried self parameter which needs to be
52
+ // / skipped.
55
53
// /
56
- // / entityType specifies a specific type to use for this decl/expr that may be
57
- // / more resolved than the concrete type. For example, it may have generic
54
+ // / ` entityType` specifies a specific type to use for this decl/expr that may
55
+ // / be more resolved than the concrete type. For example, it may have generic
58
56
// / arguments substituted in.
59
57
// /
60
- struct UncurriedCandidate {
58
+ struct OverloadCandidate {
61
59
PointerUnion<ValueDecl *, Expr*> declOrExpr;
62
60
bool skipCurriedSelf;
63
61
Type entityType;
@@ -70,12 +68,12 @@ namespace swift {
70
68
//
71
69
// FIXME: Clean this up.
72
70
bool substituted;
73
-
74
- UncurriedCandidate (ValueDecl *decl, bool skipCurriedSelf);
75
- UncurriedCandidate (Expr *expr, Type type)
76
- : declOrExpr(expr), skipCurriedSelf(false ), entityType(type),
77
- substituted (true ) {}
78
-
71
+
72
+ OverloadCandidate (ValueDecl *decl, bool skipCurriedSelf);
73
+ OverloadCandidate (Expr *expr, Type type)
74
+ : declOrExpr(expr), skipCurriedSelf(false ), entityType(type),
75
+ substituted (true ) {}
76
+
79
77
ValueDecl *getDecl () const {
80
78
return declOrExpr.dyn_cast <ValueDecl*>();
81
79
}
@@ -150,8 +148,8 @@ namespace swift {
150
148
bool hasTrailingClosure;
151
149
152
150
// / This is the list of candidates identified.
153
- SmallVector<UncurriedCandidate , 4 > candidates;
154
-
151
+ SmallVector<OverloadCandidate , 4 > candidates;
152
+
155
153
// / This tracks how close the candidates are, after filtering.
156
154
CandidateCloseness closeness = CC_GeneralMismatch;
157
155
@@ -196,25 +194,23 @@ namespace swift {
196
194
197
195
using ClosenessResultTy = std::pair<CandidateCloseness, FailedArgumentInfo>;
198
196
using ClosenessPredicate =
199
- const std::function<ClosenessResultTy(UncurriedCandidate )> &;
197
+ const std::function<ClosenessResultTy(OverloadCandidate )> &;
200
198
201
199
// / After the candidate list is formed, it can be filtered down to discard
202
200
// / obviously mismatching candidates and compute a "closeness" for the
203
201
// / resultant set.
204
202
ClosenessResultTy
205
- evaluateCloseness (UncurriedCandidate candidate,
203
+ evaluateCloseness (OverloadCandidate candidate,
206
204
ArrayRef<AnyFunctionType::Param> actualArgs);
207
-
205
+
208
206
void filterListArgs (ArrayRef<AnyFunctionType::Param> actualArgs);
209
207
void filterList (ClosenessPredicate predicate);
210
208
void filterContextualMemberList (Expr *argExpr);
211
209
212
210
bool empty () const { return candidates.empty (); }
213
211
unsigned size () const { return candidates.size (); }
214
- UncurriedCandidate operator [](unsigned i) const {
215
- return candidates[i];
216
- }
217
-
212
+ OverloadCandidate operator [](unsigned i) const { return candidates[i]; }
213
+
218
214
// / Given a set of parameter lists from an overload group, and a list of
219
215
// / arguments, emit a diagnostic indicating any partially matching
220
216
// / overloads.
0 commit comments