@@ -3301,13 +3301,12 @@ static ConstraintResult visitInherited(
3301
3301
}
3302
3302
3303
3303
ConstraintResult GenericSignatureBuilder::expandConformanceRequirement (
3304
- PotentialArchetype *pa ,
3304
+ ResolvedType selfType ,
3305
3305
ProtocolDecl *proto,
3306
3306
const RequirementSource *source,
3307
3307
bool onlySameTypeConstraints) {
3308
- auto concreteSelf = pa->getDependentType ({});
3309
3308
auto protocolSubMap = SubstitutionMap::getProtocolSubstitutions (
3310
- proto, concreteSelf , ProtocolConformanceRef (proto));
3309
+ proto, selfType. getDependentType () , ProtocolConformanceRef (proto));
3311
3310
3312
3311
// Use the requirement signature to avoid rewalking the entire protocol. This
3313
3312
// cannot compute the requirement signature directly, because that may be
@@ -3339,7 +3338,8 @@ ConstraintResult GenericSignatureBuilder::expandConformanceRequirement(
3339
3338
resolver->resolveInheritedProtocols (proto);
3340
3339
3341
3340
auto inheritedReqResult =
3342
- addInheritedRequirements (proto, pa, source, protoModule);
3341
+ addInheritedRequirements (proto, selfType.getUnresolvedType (), source,
3342
+ protoModule);
3343
3343
if (isErrorResult (inheritedReqResult))
3344
3344
return inheritedReqResult;
3345
3345
}
@@ -3467,7 +3467,8 @@ ConstraintResult GenericSignatureBuilder::expandConformanceRequirement(
3467
3467
for (auto Member : proto->getMembers ()) {
3468
3468
if (auto assocTypeDecl = dyn_cast<AssociatedTypeDecl>(Member)) {
3469
3469
// Add requirements placed directly on this associated type.
3470
- Type assocType = DependentMemberType::get (concreteSelf, assocTypeDecl);
3470
+ Type assocType =
3471
+ DependentMemberType::get (selfType.getDependentType (), assocTypeDecl);
3471
3472
if (!onlySameTypeConstraints) {
3472
3473
auto assocResult =
3473
3474
addInheritedRequirements (assocTypeDecl, assocType, source,
@@ -3614,10 +3615,8 @@ ConstraintResult GenericSignatureBuilder::addConformanceRequirement(
3614
3615
if (!equivClass->recordConformanceConstraint (type, proto, source))
3615
3616
return ConstraintResult::Resolved;
3616
3617
3617
- // FIXME: Resolve later.
3618
- auto pa = type.realizePotentialArchetype (*this );
3619
3618
auto resolvedSource = source.getSource (*this , type.getDependentType ());
3620
- return expandConformanceRequirement (pa , proto, resolvedSource,
3619
+ return expandConformanceRequirement (type , proto, resolvedSource,
3621
3620
/* onlySameTypeRequirements=*/ false );
3622
3621
}
3623
3622
0 commit comments