@@ -209,19 +209,17 @@ getTypesToCompare(ValueDecl *reqt, Type reqtType, bool reqtTypeIsIUO,
209
209
210
210
// / Check that the Objective-C method(s) provided by the witness have
211
211
// / the same selectors as those required by the requirement.
212
- static bool checkObjCWitnessSelector (TypeChecker &tc, ValueDecl *req,
213
- ValueDecl *witness) {
212
+ static bool checkObjCWitnessSelector (ValueDecl *req, ValueDecl *witness) {
214
213
// Simple case: for methods and initializers, check that the selectors match.
215
214
if (auto reqFunc = dyn_cast<AbstractFunctionDecl>(req)) {
216
215
auto witnessFunc = cast<AbstractFunctionDecl>(witness);
217
216
if (reqFunc->getObjCSelector () == witnessFunc->getObjCSelector ())
218
217
return false ;
219
218
220
219
auto diagInfo = getObjCMethodDiagInfo (witnessFunc);
221
- auto diag = tc.diagnose (witness, diag::objc_witness_selector_mismatch,
222
- diagInfo.first , diagInfo.second ,
223
- witnessFunc->getObjCSelector (),
224
- reqFunc->getObjCSelector ());
220
+ auto diag = witness->diagnose (
221
+ diag::objc_witness_selector_mismatch, diagInfo.first , diagInfo.second ,
222
+ witnessFunc->getObjCSelector (), reqFunc->getObjCSelector ());
225
223
fixDeclarationObjCName (diag, witnessFunc,
226
224
witnessFunc->getObjCSelector (),
227
225
reqFunc->getObjCSelector ());
@@ -239,15 +237,15 @@ static bool checkObjCWitnessSelector(TypeChecker &tc, ValueDecl *req,
239
237
if (auto reqGetter = reqStorage->getParsedAccessor (AccessorKind::Get)) {
240
238
auto *witnessGetter =
241
239
witnessStorage->getSynthesizedAccessor (AccessorKind::Get);
242
- if (checkObjCWitnessSelector (tc, reqGetter, witnessGetter))
240
+ if (checkObjCWitnessSelector (reqGetter, witnessGetter))
243
241
return true ;
244
242
}
245
243
246
244
// Check the setter.
247
245
if (auto reqSetter = reqStorage->getParsedAccessor (AccessorKind::Set)) {
248
246
auto *witnessSetter =
249
247
witnessStorage->getSynthesizedAccessor (AccessorKind::Set);
250
- if (checkObjCWitnessSelector (tc, reqSetter, witnessSetter))
248
+ if (checkObjCWitnessSelector (reqSetter, witnessSetter))
251
249
return true ;
252
250
}
253
251
@@ -932,10 +930,9 @@ WitnessChecker::lookupValueWitnesses(ValueDecl *req, bool *ignoringNames) {
932
930
auto lookupOptions = defaultUnqualifiedLookupOptions;
933
931
if (!DC->isCascadingContextForLookup (false ))
934
932
lookupOptions |= NameLookupFlags::KnownPrivate;
935
- auto lookup = TC.lookupUnqualified (DC->getModuleScopeContext (),
936
- req->getBaseName (),
937
- SourceLoc (),
938
- lookupOptions);
933
+ auto lookup = TypeChecker::lookupUnqualified (DC->getModuleScopeContext (),
934
+ req->getBaseName (),
935
+ SourceLoc (), lookupOptions);
939
936
for (auto candidate : lookup) {
940
937
auto decl = candidate.getValueDecl ();
941
938
if (swift::isMemberOperator (cast<FuncDecl>(decl), Adoptee)) {
@@ -1007,8 +1004,8 @@ bool WitnessChecker::findBestWitness(
1007
1004
1008
1005
auto lookupOptions = defaultUnqualifiedLookupOptions;
1009
1006
lookupOptions |= NameLookupFlags::KnownPrivate;
1010
- auto lookup = TC. lookupUnqualified (overlay, requirement-> getBaseName (),
1011
- SourceLoc (), lookupOptions);
1007
+ auto lookup = TypeChecker:: lookupUnqualified (
1008
+ overlay, requirement-> getBaseName (), SourceLoc (), lookupOptions);
1012
1009
for (auto candidate : lookup)
1013
1010
witnesses.push_back (candidate.getValueDecl ());
1014
1011
break ;
@@ -3492,8 +3489,8 @@ ResolveWitnessResult ConformanceChecker::resolveTypeWitnessViaLookup(
3492
3489
}
3493
3490
3494
3491
// Look for a member type with the same name as the associated type.
3495
- auto candidates = TC. lookupMemberType (DC, Adoptee, assocType-> getName (),
3496
- NameLookupFlags::ProtocolMembers);
3492
+ auto candidates = TypeChecker:: lookupMemberType (
3493
+ DC, Adoptee, assocType-> getName (), NameLookupFlags::ProtocolMembers);
3497
3494
3498
3495
// If there aren't any candidates, we're done.
3499
3496
if (!candidates) {
@@ -3838,7 +3835,7 @@ void ConformanceChecker::resolveValueWitnesses() {
3838
3835
}
3839
3836
3840
3837
// The selectors must coincide.
3841
- if (checkObjCWitnessSelector (TC, requirement, witness)) {
3838
+ if (checkObjCWitnessSelector (requirement, witness)) {
3842
3839
Conformance->setInvalid ();
3843
3840
return ;
3844
3841
}
0 commit comments