Skip to content

Commit 17e3ee7

Browse files
committed
GSB: Don't emit diagnostics with <<error type>> in them
1 parent 891e053 commit 17e3ee7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/AST/GenericSignatureBuilder.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5103,7 +5103,9 @@ ConstraintResult GenericSignatureBuilder::addSameTypeRequirement(
51035103
return addSameTypeRequirement(paOrT1, paOrT2, source, unresolvedHandling,
51045104
[&](Type type1, Type type2) {
51055105
Impl->HadAnyError = true;
5106-
if (source.getLoc().isValid()) {
5106+
if (source.getLoc().isValid() &&
5107+
!type1->hasError() &&
5108+
!type2->hasError()) {
51075109
Diags.diagnose(source.getLoc(), diag::requires_same_concrete_type,
51085110
type1, type2);
51095111
}
@@ -5284,7 +5286,9 @@ GenericSignatureBuilder::addRequirement(const Requirement &req,
52845286
UnresolvedHandlingKind::GenerateConstraints,
52855287
[&](Type type1, Type type2) {
52865288
Impl->HadAnyError = true;
5287-
if (source.getLoc().isValid()) {
5289+
if (source.getLoc().isValid() &&
5290+
!type1->hasError() &&
5291+
!type2->hasError()) {
52885292
Diags.diagnose(source.getLoc(), diag::requires_same_concrete_type,
52895293
type1, type2);
52905294
}

0 commit comments

Comments
 (0)