mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: Preserve identity of opened generic environments
We used to create a new environment for each opened archetype, which is incorrect when deserializing a nested type of another opened archetype.
This commit is contained in:
@@ -259,6 +259,9 @@ private:
|
||||
/// Generic signatures referenced by this module.
|
||||
MutableArrayRef<Serialized<GenericSignature>> GenericSignatures;
|
||||
|
||||
/// Generic environments referenced by this module.
|
||||
MutableArrayRef<Serialized<GenericEnvironment *>> GenericEnvironments;
|
||||
|
||||
/// Substitution maps referenced by this module.
|
||||
MutableArrayRef<Serialized<SubstitutionMap>> SubstitutionMaps;
|
||||
|
||||
@@ -862,6 +865,10 @@ public:
|
||||
llvm::Expected<GenericSignature>
|
||||
getGenericSignatureChecked(serialization::GenericSignatureID ID);
|
||||
|
||||
/// Returns the generic environment for the given ID or the first error.
|
||||
llvm::Expected<GenericEnvironment *>
|
||||
getGenericEnvironmentChecked(serialization::GenericEnvironmentID ID);
|
||||
|
||||
/// Returns the substitution map for the given ID, deserializing it if
|
||||
/// needed.
|
||||
SubstitutionMap getSubstitutionMap(serialization::SubstitutionMapID id);
|
||||
|
||||
Reference in New Issue
Block a user