mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Carry through the ordinal for opaque type declarations.
Generalize the implementation of opaque type declarations to maintain the "ordinal", which represents a particular "some" utterance in a structural opaque type, throughout more of the compiler. The ordinal value for a given "some" matches with the index of the corresponding generic parameter in the opaque type declaration's generic signature. To properly be able to determine the ordinal for a given "some" type representation, retain all of the "some" type representations in the `OpaqueTypeDecl` (using trailing storage), so we can map them to the proper generic parameter and ordinal later on.
This commit is contained in:
@@ -4275,9 +4275,7 @@ DependentMemberType *DependentMemberType::get(Type base,
|
||||
OpaqueTypeArchetypeType *
|
||||
OpaqueTypeArchetypeType::get(OpaqueTypeDecl *Decl, unsigned ordinal,
|
||||
SubstitutionMap Substitutions) {
|
||||
// TODO [OPAQUE SUPPORT]: multiple opaque types
|
||||
assert(ordinal == 0 && "we only support one 'some' type per composite type");
|
||||
auto opaqueParamType = Decl->getUnderlyingInterfaceType();
|
||||
auto opaqueParamType = Decl->getOpaqueGenericParams()[ordinal];
|
||||
|
||||
// TODO: We could attempt to preserve type sugar in the substitution map.
|
||||
// Currently archetypes are assumed to be always canonical in many places,
|
||||
|
||||
Reference in New Issue
Block a user