@@ -1339,6 +1339,9 @@ AssociatedTypeInference::inferTypeWitnessesViaValueWitnesses(
13391339
13401340 InferredAssociatedTypesByWitnesses result;
13411341
1342+ LLVM_DEBUG (llvm::dbgs () << " Considering requirement:\n " ;
1343+ req->dump (llvm::dbgs ()));
1344+
13421345 for (auto witness :
13431346 lookupValueWitnesses (dc, req, /* ignoringNames=*/ nullptr )) {
13441347 LLVM_DEBUG (llvm::dbgs () << " Inferring associated types from decl:\n " ;
@@ -1620,6 +1623,7 @@ static Type getWitnessTypeForMatching(NormalProtocolConformance *conformance,
16201623 conformance->getDeclContext ()->mapTypeIntoContext (conformance->getType ());
16211624 TypeSubstitutionMap substitutions = model->getMemberSubstitutions (witness);
16221625 Type type = witness->getInterfaceType ()->getReferenceStorageReferent ();
1626+ LLVM_DEBUG (llvm::dbgs () << " Witness interface type is " << type << " \n " ;);
16231627
16241628 if (substitutions.empty ())
16251629 return type;
@@ -2139,9 +2143,14 @@ void AssociatedTypeInference::collectAbstractTypeWitnesses(
21392143 if (ctx.isRecursivelyConstructingRequirementMachine (
21402144 conformedProto->getGenericSignature ().getCanonicalSignature ()) ||
21412145 ctx.isRecursivelyConstructingRequirementMachine (conformedProto) ||
2142- conformedProto->isComputingRequirementSignature ())
2146+ conformedProto->isComputingRequirementSignature ()) {
2147+ LLVM_DEBUG (llvm::dbgs () << " Skipping circular protocol "
2148+ << conformedProto->getName () << " \n " );
21432149 return ;
2150+ }
21442151
2152+ LLVM_DEBUG (llvm::dbgs () << " Collecting same-type requirements from "
2153+ << conformedProto->getName () << " \n " );
21452154 for (const auto &req :
21462155 conformedProto->getRequirementSignature ().getRequirements ()) {
21472156 if (req.getKind () == RequirementKind::SameType)
0 commit comments