mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Use PackElementType to model references to pack elements of outer expansions
This commit is contained in:
@@ -119,7 +119,9 @@ ProtocolConformanceRef::subst(Type origType, InFlightSubstitution &IFS) const {
|
||||
}
|
||||
|
||||
// Check the conformance map.
|
||||
return IFS.lookupConformance(origType->getCanonicalType(), substType, proto);
|
||||
// FIXME: Pack element level?
|
||||
return IFS.lookupConformance(origType->getCanonicalType(), substType, proto,
|
||||
/*level=*/0);
|
||||
}
|
||||
|
||||
ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() const {
|
||||
@@ -130,7 +132,8 @@ ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() cons
|
||||
return archetypeType->getInterfaceType();
|
||||
return type;
|
||||
},
|
||||
MakeAbstractConformanceForGenericType());
|
||||
MakeAbstractConformanceForGenericType(),
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
return ProtocolConformanceRef(concrete);
|
||||
} else if (isPack()) {
|
||||
return getPack()->subst(
|
||||
@@ -139,7 +142,8 @@ ProtocolConformanceRef ProtocolConformanceRef::mapConformanceOutOfContext() cons
|
||||
return archetypeType->getInterfaceType();
|
||||
return type;
|
||||
},
|
||||
MakeAbstractConformanceForGenericType());
|
||||
MakeAbstractConformanceForGenericType(),
|
||||
SubstFlags::PreservePackExpansionLevel);
|
||||
}
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user