@@ -4173,24 +4173,6 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
4173
4173
if (!instanceTy->mayHaveMembers ())
4174
4174
return result;
4175
4175
4176
- // If we have a simple name, determine whether there are argument
4177
- // labels we can use to restrict the set of lookup results.
4178
- Optional<ArgumentLabelState> argumentLabels;
4179
- if (memberName.isSimpleName ()) {
4180
- argumentLabels = getArgumentLabels (*this ,
4181
- ConstraintLocatorBuilder (memberLocator));
4182
-
4183
- // If we're referencing AnyObject and we have argument labels, put
4184
- // the argument labels into the name: we don't want to look for
4185
- // anything else, because the cost of the general search is so
4186
- // high.
4187
- if (baseObjTy->isAnyObject () && argumentLabels) {
4188
- memberName = DeclName (TC.Context , memberName.getBaseName (),
4189
- argumentLabels->Labels );
4190
- argumentLabels.reset ();
4191
- }
4192
- }
4193
-
4194
4176
// Look for members within the base.
4195
4177
LookupResult &lookup = lookupMember (instanceTy, memberName);
4196
4178
@@ -4226,7 +4208,6 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
4226
4208
bridgedType = classType;
4227
4209
}
4228
4210
}
4229
- bool labelMismatch = false ;
4230
4211
4231
4212
// Local function that adds the given declaration if it is a
4232
4213
// reasonable choice.
@@ -4291,20 +4272,6 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
4291
4272
hasInstanceMethods = true ;
4292
4273
}
4293
4274
4294
- // If the argument labels for this result are incompatible with
4295
- // the call site, skip it.
4296
- // FIXME: The subscript check here forces the use of the
4297
- // function-application simplification logic to handle labels.
4298
- if (argumentLabels &&
4299
- (!candidate.isDecl () || !isa<SubscriptDecl>(candidate.getDecl ())) &&
4300
- !areConservativelyCompatibleArgumentLabels (
4301
- candidate, argumentLabels->Labels ,
4302
- argumentLabels->HasTrailingClosure )) {
4303
- labelMismatch = true ;
4304
- result.addUnviable (candidate, MemberLookupResult::UR_LabelMismatch);
4305
- return ;
4306
- }
4307
-
4308
4275
// If our base is an existential type, we can't make use of any
4309
4276
// member whose signature involves associated types.
4310
4277
if (instanceTy->isExistentialType ()) {
@@ -4494,8 +4461,6 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
4494
4461
};
4495
4462
4496
4463
// Add all results from this lookup.
4497
- retry_after_fail:
4498
- labelMismatch = false ;
4499
4464
for (auto result : lookup)
4500
4465
addChoice (getOverloadChoice (result.getValueDecl (),
4501
4466
/* isBridged=*/ false ,
@@ -4603,14 +4568,6 @@ performMemberLookup(ConstraintKind constraintKind, DeclName memberName,
4603
4568
}
4604
4569
}
4605
4570
4606
- // If we rejected some possibilities due to an argument-label
4607
- // mismatch and ended up with nothing, try again ignoring the
4608
- // labels. This allows us to perform typo correction on the labels.
4609
- if (result.ViableCandidates .empty () && labelMismatch && shouldAttemptFixes ()){
4610
- argumentLabels.reset ();
4611
- goto retry_after_fail;
4612
- }
4613
-
4614
4571
// If we have no viable or unviable candidates, and we're generating,
4615
4572
// diagnostics, rerun the query with inaccessible members included, so we can
4616
4573
// include them in the unviable candidates list.
@@ -4855,7 +4812,6 @@ fixMemberRef(ConstraintSystem &cs, Type baseTy,
4855
4812
: nullptr ;
4856
4813
}
4857
4814
4858
- case MemberLookupResult::UR_LabelMismatch:
4859
4815
// TODO(diagnostics): Add a new fix that is suggests to
4860
4816
// add `subscript(dynamicMember: {Writable}KeyPath<T, U>)`
4861
4817
// overload here, that would help if such subscript has
0 commit comments