File tree Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Expand file tree Collapse file tree 2 files changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -806,7 +806,7 @@ matchWitness(TypeChecker &tc,
806
806
}
807
807
808
808
SmallVector<OptionalAdjustment, 2 > optionalAdjustments;
809
- bool anyRenaming = false ;
809
+ bool anyRenaming = req-> getFullName () != witness-> getFullName () ;
810
810
if (decomposeFunctionType) {
811
811
// Decompose function types into parameters and result type.
812
812
auto reqFnType = reqType->castTo <AnyFunctionType>();
@@ -853,12 +853,6 @@ matchWitness(TypeChecker &tc,
853
853
if (reqParams[i].isVararg () != witnessParams[i].isVararg ())
854
854
return RequirementMatch (witness, MatchKind::TypeConflict, witnessType);
855
855
856
- // Check the parameter names.
857
- if (reqParams[i].getName () != witnessParams[i].getName ()) {
858
- // A parameter has been renamed.
859
- anyRenaming = true ;
860
- }
861
-
862
856
// Gross hack: strip a level of unchecked-optionality off both
863
857
// sides when matching against a protocol imported from Objective-C.
864
858
auto types = getTypesToCompare (req, reqParams[i].getType (),
Original file line number Diff line number Diff line change @@ -2033,6 +2033,7 @@ class ConformsToProtocolThrowsObjCName2 : ProtocolThrowsObjCName {
2033
2033
// expected-warning@-1{{instance method 'doThing' nearly matches optional requirement 'doThing' of protocol 'ProtocolThrowsObjCName'}}
2034
2034
// expected-note@-2{{move 'doThing' to an extension to silence this warning}}
2035
2035
// expected-note@-3{{make 'doThing' private to silence this warning}}{{9-9=private }}
2036
+ // expected-note@-4{{candidate has non-matching type '(Int) throws -> String'}}
2036
2037
}
2037
2038
2038
2039
@objc class DictionaryTest {
You can’t perform that action at this time.
0 commit comments