@@ -1339,6 +1339,9 @@ AssociatedTypeInference::inferTypeWitnessesViaValueWitnesses(
1339
1339
1340
1340
InferredAssociatedTypesByWitnesses result;
1341
1341
1342
+ LLVM_DEBUG (llvm::dbgs () << " Considering requirement:\n " ;
1343
+ req->dump (llvm::dbgs ()));
1344
+
1342
1345
for (auto witness :
1343
1346
lookupValueWitnesses (dc, req, /* ignoringNames=*/ nullptr )) {
1344
1347
LLVM_DEBUG (llvm::dbgs () << " Inferring associated types from decl:\n " ;
@@ -1620,6 +1623,7 @@ static Type getWitnessTypeForMatching(NormalProtocolConformance *conformance,
1620
1623
conformance->getDeclContext ()->mapTypeIntoContext (conformance->getType ());
1621
1624
TypeSubstitutionMap substitutions = model->getMemberSubstitutions (witness);
1622
1625
Type type = witness->getInterfaceType ()->getReferenceStorageReferent ();
1626
+ LLVM_DEBUG (llvm::dbgs () << " Witness interface type is " << type << " \n " ;);
1623
1627
1624
1628
if (substitutions.empty ())
1625
1629
return type;
@@ -2139,9 +2143,14 @@ void AssociatedTypeInference::collectAbstractTypeWitnesses(
2139
2143
if (ctx.isRecursivelyConstructingRequirementMachine (
2140
2144
conformedProto->getGenericSignature ().getCanonicalSignature ()) ||
2141
2145
ctx.isRecursivelyConstructingRequirementMachine (conformedProto) ||
2142
- conformedProto->isComputingRequirementSignature ())
2146
+ conformedProto->isComputingRequirementSignature ()) {
2147
+ LLVM_DEBUG (llvm::dbgs () << " Skipping circular protocol "
2148
+ << conformedProto->getName () << " \n " );
2143
2149
return ;
2150
+ }
2144
2151
2152
+ LLVM_DEBUG (llvm::dbgs () << " Collecting same-type requirements from "
2153
+ << conformedProto->getName () << " \n " );
2145
2154
for (const auto &req :
2146
2155
conformedProto->getRequirementSignature ().getRequirements ()) {
2147
2156
if (req.getKind () == RequirementKind::SameType)
0 commit comments