Skip to content

Commit e437a0e

Browse files
committed
Fix duplicate error and re-categorize test
This crashing test became non-crashing in #138. #138 also emitted multiple instances of the same diagnostic, which was causing -verify to fail on decl/protocol/req/recursion.swift.
1 parent 03e07ba commit e437a0e

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3194,12 +3194,11 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
31943194
void visitAssociatedTypeDecl(AssociatedTypeDecl *assocType) {
31953195
if (assocType->isBeingTypeChecked()) {
31963196

3197-
if (!assocType->hasType()) {
3197+
if (!assocType->isInvalid()) {
31983198
assocType->setInvalid();
31993199
assocType->overwriteType(ErrorType::get(TC.Context));
3200+
TC.diagnose(assocType->getLoc(), diag::circular_type_alias, assocType->getName());
32003201
}
3201-
3202-
TC.diagnose(assocType->getLoc(), diag::circular_type_alias, assocType->getName());
32033202
return;
32043203
}
32053204

validation-test/compiler_crashers/1741-swift-constraints-constraintsystem-simplifymemberconstraint.swift renamed to validation-test/compiler_crashers_fixed/1741-swift-constraints-constraintsystem-simplifymemberconstraint.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: not --crash %target-swift-frontend %s -parse
1+
// RUN: not %target-swift-frontend %s -parse
22

33
// Distributed under the terms of the MIT license
44
// Test case submitted to project by https://github.com/practicalswift (practicalswift)

0 commit comments

Comments
 (0)