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:
Slava Pestov
2019-09-05 00:02:02 -04:00
parent e9bcd00bc2
commit 1e94466bcc
19 changed files with 42 additions and 36 deletions

View File

@@ -453,7 +453,7 @@ configureGenericDesignatedInitOverride(ASTContext &ctx,
std::move(requirements)
},
nullptr);
genericEnv = genericSig->createGenericEnvironment();
genericEnv = genericSig->getGenericEnvironment();
} else {
genericEnv = classDecl->getGenericEnvironment();
}