mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Replace GenericSignature::createGenericEnvironment() with getGenericEnvironment()
This memoizes the result, which is fine for all callers; the only exception is open existential types where each new open existential now explicitly gets a unique generic environment, allocated by calling GenericEnvironment::getIncomplete().
This commit is contained in:
@@ -943,7 +943,7 @@ ModuleFile::getGenericSignatureOrEnvironment(
|
||||
|
||||
if (wantEnvironment)
|
||||
if (auto *sig = sigOrEnvOrOffset.get().dyn_cast<GenericSignature *>())
|
||||
sigOrEnvOrOffset.uncheckedOverwrite(sig->createGenericEnvironment());
|
||||
sigOrEnvOrOffset.uncheckedOverwrite(sig->getGenericEnvironment());
|
||||
|
||||
return sigOrEnvOrOffset.get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user