File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -2650,6 +2650,12 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
26502650
26512651 TypeChecker::checkDeclAttributes (PD);
26522652
2653+ // Explicity compute the requirement signature to detect errors.
2654+ // Do this before visiting members, to avoid a request cycle if
2655+ // a member referenecs another declaration whose generic signature
2656+ // has a conformance requirement to this protocol.
2657+ auto reqSig = PD->getRequirementSignature ().getRequirements ();
2658+
26532659 // Check the members.
26542660 for (auto Member : PD->getMembers ())
26552661 visit (Member);
@@ -2663,9 +2669,6 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
26632669 if (!SF || SF->Kind != SourceFileKind::Interface)
26642670 TypeChecker::inferDefaultWitnesses (PD);
26652671
2666- // Explicity compute the requirement signature to detect errors.
2667- auto reqSig = PD->getRequirementSignature ().getRequirements ();
2668-
26692672 if (PD->getASTContext ().TypeCheckerOpts .DebugGenericSignatures ) {
26702673 auto requirementsSig =
26712674 GenericSignature::get ({PD->getProtocolSelfType ()}, reqSig);
Original file line number Diff line number Diff line change 1+ // RUN: %target-typecheck-verify-swift
2+
3+ protocol P {
4+ associatedtype X
5+ associatedtype Y where Y : Q
6+ }
7+
8+ protocol Q {
9+ associatedtype T
10+ }
11+
12+ struct S : Q {
13+ typealias T = Int
14+ }
15+
16+ extension P where X == ( ) {
17+ typealias Y = S
18+ }
You can’t perform that action at this time.
0 commit comments