mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Respect resilience when specializing opaque type archetypes
This commit is contained in:
@@ -111,8 +111,9 @@ public:
|
||||
|
||||
/// Replace opaque types in the conforming type with their underlying types,
|
||||
/// and resolve opaque conformances to their underlying conformances.
|
||||
ProtocolConformanceRef substOpaqueTypesWithUnderlyingTypes(Type origType) const;
|
||||
|
||||
ProtocolConformanceRef substOpaqueTypesWithUnderlyingTypes(
|
||||
Type origType, ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
/// Given a dependent type (expressed in terms of this conformance's
|
||||
/// protocol), follow it from the conforming type.
|
||||
Type getAssociatedType(Type origType, Type dependentType,
|
||||
|
||||
@@ -177,7 +177,8 @@ public:
|
||||
|
||||
/// Replace opaque types in the replacement types in the map with their
|
||||
/// underlying types. Does not change keys.
|
||||
SubstitutionMap substOpaqueTypesWithUnderlyingTypes() const;
|
||||
SubstitutionMap substOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
/// Create a substitution map for a protocol conformance.
|
||||
static SubstitutionMap
|
||||
|
||||
@@ -318,7 +318,8 @@ public:
|
||||
|
||||
/// Replace opaque types with their underlying types when visible at the given
|
||||
/// resilience expansion.
|
||||
Type substOpaqueTypesWithUnderlyingTypes() const;
|
||||
Type substOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution) const;
|
||||
|
||||
bool isPrivateStdlibType(bool treatNonBuiltinProtocolsAsPublic = true) const;
|
||||
|
||||
|
||||
@@ -4827,8 +4827,11 @@ END_CAN_TYPE_WRAPPER(OpaqueTypeArchetypeType, ArchetypeType)
|
||||
/// to their underlying types.
|
||||
class ReplaceOpaqueTypesWithUnderlyingTypes {
|
||||
public:
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes() {}
|
||||
|
||||
ModuleDecl *modulePerformingSubstitution;
|
||||
ReplaceOpaqueTypesWithUnderlyingTypes(
|
||||
ModuleDecl *modulePerformingSubstitution)
|
||||
: modulePerformingSubstitution(modulePerformingSubstitution) {}
|
||||
|
||||
/// TypeSubstitutionFn
|
||||
Type operator()(SubstitutableType *maybeOpaqueType) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user