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(
3747
3747
assert (argTypes.size () <= assocTypes.size ());
3748
3748
3749
3749
auto conformance = lookupConformance (baseType, protoDecl);
3750
+ auto subMap = SubstitutionMap::getProtocolSubstitutions (
3751
+ protoDecl, baseType, conformance);
3750
3752
3751
3753
for (unsigned i : indices (argTypes)) {
3752
3754
auto argType = argTypes[i];
3753
3755
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);
3756
3760
reqs.emplace_back (RequirementKind::SameType, subjectType, argType);
3757
3761
}
3758
3762
}
You can’t perform that action at this time.
0 commit comments