mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] openOpaqueType: remove logic that duplicates bindArchetypesFromContext
`openGenericParameters` calls `bindArchetypesFromContext` which would bind all of the external generic parameters in the opaque type signature. Resolves: rdar://107280056
This commit is contained in:
@@ -1009,22 +1009,11 @@ Type ConstraintSystem::openOpaqueType(OpaqueTypeArchetypeType *opaque,
|
||||
// underlying return type.
|
||||
auto opaqueLocator = locator.withPathElement(
|
||||
LocatorPathElt::OpenedOpaqueArchetype(opaqueDecl));
|
||||
|
||||
OpenedTypeMap replacements;
|
||||
openGeneric(DC, opaqueDecl->getOpaqueInterfaceGenericSignature(),
|
||||
opaqueLocator, replacements);
|
||||
|
||||
// If there is an outer generic signature, bind the outer parameters based
|
||||
// on the substitutions in the opaque type.
|
||||
auto subs = opaque->getSubstitutions();
|
||||
if (auto genericSig = subs.getGenericSignature()) {
|
||||
for (auto *genericParamPtr : genericSig.getGenericParams()) {
|
||||
Type genericParam(genericParamPtr);
|
||||
addConstraint(
|
||||
ConstraintKind::Bind, openType(genericParam, replacements),
|
||||
genericParam.subst(subs), opaqueLocator);
|
||||
}
|
||||
}
|
||||
|
||||
recordOpenedTypes(opaqueLocatorKey, replacements);
|
||||
|
||||
return openType(opaque->getInterfaceType(), replacements);
|
||||
|
||||
Reference in New Issue
Block a user