Skip to content

Commit b1439c1

Browse files
committed
Sema: Simplify ConformanceChecker::emitDelayedDiags()
1 parent 18b34e5 commit b1439c1

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5752,10 +5752,13 @@ void ConformanceChecker::emitDelayedDiags() {
57525752

57535753
assert(!SuppressDiagnostics && "Should not be suppressing diagnostics now");
57545754
for (const auto &diag: diags) {
5755-
diagnoseOrDefer(diag.Requirement, diag.IsError,
5756-
[&](NormalProtocolConformance *conformance) {
5757-
return diag.Callback();
5758-
});
5755+
// Complain that the type does not conform, once.
5756+
if (diag.IsError && !AlreadyComplained) {
5757+
diagnoseConformanceFailure(Adoptee, Proto, DC, Loc);
5758+
AlreadyComplained = true;
5759+
}
5760+
5761+
diag.Callback();
57595762
}
57605763
}
57615764

0 commit comments

Comments
 (0)