Skip to content

Commit 8b386d2

Browse files
authored
Merge pull request #86021 from slavapestov/opaque-archetype-sugar-type-variable-6.3
AST: Canonicalize opaque archetype substitution maps in the solver arena [6.3]
2 parents d994b27 + 4201ed3 commit 8b386d2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/AST/ASTContext.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6086,6 +6086,11 @@ GenericEnvironment *GenericEnvironment::forPrimary(GenericSignature signature) {
60866086
/// outer substitutions.
60876087
GenericEnvironment *GenericEnvironment::forOpaqueType(
60886088
OpaqueTypeDecl *opaque, SubstitutionMap subs) {
6089+
// Don't preserve sugar if we have type variables, because this leads to
6090+
// excessive solver arena memory usage.
6091+
if (subs.getRecursiveProperties().hasTypeVariable())
6092+
subs = subs.getCanonical();
6093+
60896094
auto &ctx = opaque->getASTContext();
60906095

60916096
auto properties = ArchetypeType::archetypeProperties(

0 commit comments

Comments
 (0)