@@ -4849,15 +4849,11 @@ TypeChecker::containsProtocol(Type T, ProtocolDecl *Proto, DeclContext *DC,
4849
4849
}
4850
4850
4851
4851
ProtocolConformanceRef
4852
- TypeChecker::conformsToProtocol (Type T, ProtocolDecl *Proto, DeclContext *DC,
4853
- SourceLoc ComplainLoc) {
4852
+ TypeChecker::conformsToProtocol (Type T, ProtocolDecl *Proto, DeclContext *DC) {
4854
4853
// Look up conformance in the module.
4855
4854
ModuleDecl *M = DC->getParentModule ();
4856
4855
auto lookupResult = M->lookupConformance (T, Proto);
4857
4856
if (lookupResult.isInvalid ()) {
4858
- if (ComplainLoc.isValid ()) {
4859
- diagnoseConformanceFailure (T, Proto, DC, ComplainLoc);
4860
- }
4861
4857
return ProtocolConformanceRef::forInvalid ();
4862
4858
}
4863
4859
@@ -4869,16 +4865,8 @@ TypeChecker::conformsToProtocol(Type T, ProtocolDecl *Proto, DeclContext *DC,
4869
4865
// If we have a conditional requirements that
4870
4866
// we need to check, do so now.
4871
4867
if (!condReqs->empty ()) {
4872
- // Figure out the location of the conditional conformance.
4873
- auto conformanceDC = lookupResult.getConcrete ()->getDeclContext ();
4874
- SourceLoc noteLoc;
4875
- if (auto ext = dyn_cast<ExtensionDecl>(conformanceDC))
4876
- noteLoc = ext->getLoc ();
4877
- else
4878
- noteLoc = cast<NominalTypeDecl>(conformanceDC)->getLoc ();
4879
-
4880
4868
auto conditionalCheckResult = checkGenericArguments (
4881
- DC, ComplainLoc, noteLoc , T,
4869
+ DC, SourceLoc (), SourceLoc () , T,
4882
4870
{lookupResult.getRequirement ()->getSelfInterfaceType ()}, *condReqs,
4883
4871
[](SubstitutableType *dependentType) { return Type (dependentType); });
4884
4872
switch (conditionalCheckResult) {
0 commit comments