@@ -1853,7 +1853,6 @@ class swift::MultiConformanceChecker {
1853
1853
if (checker.AlreadyComplained )
1854
1854
continue ;
1855
1855
1856
- checker.SuppressDiagnostics = false ; // no need to restore to prev value
1857
1856
checker.emitDelayedDiags ();
1858
1857
}
1859
1858
}
@@ -2116,8 +2115,7 @@ checkIndividualConformance(NormalProtocolConformance *conformance,
2116
2115
// conformance is invalid for other reasons, so emit diagnosis now.
2117
2116
if (revivedMissingWitnesses.empty ()) {
2118
2117
// Emit any delayed diagnostics.
2119
- ConformanceChecker (getASTContext (), conformance, MissingWitnesses,
2120
- false )
2118
+ ConformanceChecker (getASTContext (), conformance, MissingWitnesses)
2121
2119
.emitDelayedDiags ();
2122
2120
}
2123
2121
}
@@ -2908,14 +2906,12 @@ diagnoseMatch(ModuleDecl *module, NormalProtocolConformance *conformance,
2908
2906
2909
2907
ConformanceChecker::ConformanceChecker (
2910
2908
ASTContext &ctx, NormalProtocolConformance *conformance,
2911
- llvm::SetVector<MissingWitness> &GlobalMissingWitnesses,
2912
- bool suppressDiagnostics)
2909
+ llvm::SetVector<MissingWitness> &GlobalMissingWitnesses)
2913
2910
: WitnessChecker(ctx, conformance->getProtocol (), conformance->getType(),
2914
2911
conformance->getDeclContext()),
2915
2912
Conformance(conformance), Loc(conformance->getLoc ()),
2916
2913
GlobalMissingWitnesses(GlobalMissingWitnesses),
2917
- LocalMissingWitnessesStartIndex(GlobalMissingWitnesses.size()),
2918
- SuppressDiagnostics(suppressDiagnostics) {}
2914
+ LocalMissingWitnessesStartIndex(GlobalMissingWitnesses.size()) {}
2919
2915
2920
2916
ConformanceChecker::~ConformanceChecker () {}
2921
2917
@@ -5485,9 +5481,6 @@ void ConformanceChecker::checkConformance(MissingWitnessDiagnosisKind Kind) {
5485
5481
FrontendStatsTracer statsTracer (getASTContext ().Stats ,
5486
5482
" check-conformance" , Conformance);
5487
5483
5488
- llvm::SaveAndRestore<bool > restoreSuppressDiagnostics (SuppressDiagnostics);
5489
- SuppressDiagnostics = false ;
5490
-
5491
5484
// FIXME: Caller checks that this type conforms to all of the
5492
5485
// inherited protocols.
5493
5486
@@ -5503,12 +5496,12 @@ void ConformanceChecker::checkConformance(MissingWitnessDiagnosisKind Kind) {
5503
5496
// Resolve all of the type witnesses.
5504
5497
resolveTypeWitnesses ();
5505
5498
5506
- // Check the requirements from the requirement signature.
5507
- ensureRequirementsAreSatisfied ();
5508
-
5509
5499
// Diagnose missing type witnesses for now.
5510
5500
diagnoseMissingWitnesses (Kind, /* Delayed=*/ false );
5511
5501
5502
+ // Check the requirements from the requirement signature.
5503
+ ensureRequirementsAreSatisfied ();
5504
+
5512
5505
// Check non-type requirements.
5513
5506
resolveValueWitnesses ();
5514
5507
@@ -5539,10 +5532,6 @@ void ConformanceChecker::checkConformance(MissingWitnessDiagnosisKind Kind) {
5539
5532
}
5540
5533
}
5541
5534
}
5542
-
5543
- if (Conformance->isInvalid ()) {
5544
- return ;
5545
- }
5546
5535
}
5547
5536
5548
5537
// / Retrieve the Objective-C method key from the given function.
@@ -5725,29 +5714,17 @@ void ConformanceChecker::diagnoseOrDefer(
5725
5714
if (isError)
5726
5715
Conformance->setInvalid ();
5727
5716
5728
- if (SuppressDiagnostics) {
5729
- // Stash this in the ASTContext for later emission.
5730
- auto conformance = Conformance;
5731
-
5732
- getASTContext ().addDelayedConformanceDiag (
5733
- conformance,
5734
- {requirement, [conformance, fn] { fn (conformance); }, isError});
5735
- return ;
5736
- }
5737
-
5738
- // Complain that the type does not conform, once.
5739
- if (isError && !AlreadyComplained) {
5740
- diagnoseConformanceFailure (Adoptee, Proto, DC, Loc);
5741
- AlreadyComplained = true ;
5742
- }
5717
+ // Stash this in the ASTContext for later emission.
5718
+ auto conformance = Conformance;
5743
5719
5744
- fn (Conformance);
5720
+ getASTContext ().addDelayedConformanceDiag (
5721
+ conformance,
5722
+ {requirement, [conformance, fn] { fn (conformance); }, isError});
5745
5723
}
5746
5724
5747
5725
void ConformanceChecker::emitDelayedDiags () {
5748
5726
auto diags = getASTContext ().takeDelayedConformanceDiags (Conformance);
5749
5727
5750
- assert (!SuppressDiagnostics && " Should not be suppressing diagnostics now" );
5751
5728
for (const auto &diag: diags) {
5752
5729
// Complain that the type does not conform, once.
5753
5730
if (diag.IsError && !AlreadyComplained) {
0 commit comments