File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -3747,12 +3747,16 @@ void ParameterizedProtocolType::getRequirements(
37473747 assert (argTypes.size () <= assocTypes.size ());
37483748
37493749 auto conformance = lookupConformance (baseType, protoDecl);
3750+ auto subMap = SubstitutionMap::getProtocolSubstitutions (
3751+ protoDecl, baseType, conformance);
37503752
37513753 for (unsigned i : indices (argTypes)) {
37523754 auto argType = argTypes[i];
37533755 auto *assocType = assocTypes[i];
3754- auto subjectType = conformance.getAssociatedType (
3755- baseType, assocType->getDeclaredInterfaceType ());
3756+ // Do a general type substitution here because the associated type might be
3757+ // from an inherited protocol, in which case we will evaluate a non-trivial
3758+ // conformance path.
3759+ auto subjectType = assocType->getDeclaredInterfaceType ().subst (subMap);
37563760 reqs.emplace_back (RequirementKind::SameType, subjectType, argType);
37573761 }
37583762}
You can’t perform that action at this time.
0 commit comments