@@ -5110,20 +5110,19 @@ void ConformanceChecker::ensureRequirementsAreSatisfied() {
5110
5110
// Diagnose the failure generically.
5111
5111
// FIXME: Would be nice to give some more context here!
5112
5112
if (!Conformance->isInvalid ()) {
5113
- diags.diagnose (Loc, diag::type_does_not_conform,
5114
- Adoptee,
5115
- Proto->getDeclaredInterfaceType ());
5116
-
5117
5113
if (result.getKind () == CheckRequirementsResult::RequirementFailure) {
5118
- TypeChecker::diagnoseRequirementFailure (
5119
- result.getRequirementFailureInfo (), Loc, Loc,
5120
- proto->getDeclaredInterfaceType (),
5121
- {proto->getSelfInterfaceType ()->castTo <GenericTypeParamType>()},
5122
- QuerySubstitutionMap{substitutions}, module );
5114
+ auto Loc = this ->Loc ;
5115
+ diagnoseOrDefer (nullptr , /* isError=*/ true ,
5116
+ [Loc, result, proto, substitutions, module ](NormalProtocolConformance *conformance) {
5117
+ TypeChecker::diagnoseRequirementFailure (
5118
+ result.getRequirementFailureInfo (), Loc, Loc,
5119
+ proto->getDeclaredInterfaceType (),
5120
+ {proto->getSelfInterfaceType ()->castTo <GenericTypeParamType>()},
5121
+ QuerySubstitutionMap{substitutions}, module );
5122
+ });
5123
5123
}
5124
5124
5125
5125
Conformance->setInvalid ();
5126
- AlreadyComplained = true ;
5127
5126
}
5128
5127
return ;
5129
5128
}
0 commit comments