Skip to content

Commit 5d59a3f

Browse files
committed
AST: Lazily compute conditional requirements in conditional conformance
In one test where we used to dump conditional requirements we now print a message that they have not been computed yet. I couldn't come up with a way to force them to be computed here, but for the most part this test is just ensuring that we don't recurse forever when printing recursive conformances.
1 parent 2d4b259 commit 5d59a3f

File tree

3 files changed

+1
-5
lines changed

3 files changed

+1
-5
lines changed

include/swift/AST/ProtocolConformance.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,6 @@ class NormalProtocolConformance : public ProtocolConformance,
415415
{
416416
assert(!conformingType->hasArchetype() &&
417417
"ProtocolConformances should store interface types");
418-
differenceAndStoreConditionalRequirements();
419418
}
420419

421420
NormalProtocolConformance(Type conformingType,
@@ -428,7 +427,6 @@ class NormalProtocolConformance : public ProtocolConformance,
428427
{
429428
assert(!conformingType->hasArchetype() &&
430429
"ProtocolConformances should store interface types");
431-
differenceAndStoreConditionalRequirements();
432430
}
433431

434432
void resolveLazyInfo() const;

lib/AST/ProtocolConformance.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,6 @@ SpecializedProtocolConformance::SpecializedProtocolConformance(
886886
GenericSubstitutions(substitutions)
887887
{
888888
assert(genericConformance->getKind() != ProtocolConformanceKind::Specialized);
889-
computeConditionalRequirements();
890889
}
891890

892891
void SpecializedProtocolConformance::computeConditionalRequirements() const {

test/Frontend/debug-generic-signatures.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ extension Super: P2 where T: P2, U: P2 {
118118
// CHECK-NEXT: (normal_conformance type=Recur protocol=P2 (details printed above))))
119119
// CHECK-NEXT: (conformance type=U
120120
// CHECK-NEXT: (normal_conformance type=Recur protocol=P2 (details printed above))))
121-
// CHECK-NEXT: conforms_to: NonRecur P2
122-
// CHECK-NEXT: conforms_to: Recur P2
121+
// CHECK-NEXT: (conditional requirements unable to be computed)
123122
// CHECK-NEXT: (normal_conformance type=Super<T, U> protocol=P2
124123
// CHECK-NEXT: (assoc_type req=A type=T)
125124
// CHECK-NEXT: (assoc_type req=B type=T)

0 commit comments

Comments
 (0)