Merge pull request #77683 from slavapestov/opened-type-optzn

Sema: Clean up and optimize interface type opening
This commit is contained in:
Slava Pestov
2024-11-18 17:40:52 -05:00
committed by GitHub
7 changed files with 106 additions and 113 deletions

View File

@@ -11534,10 +11534,9 @@ static Type getOpenedResultBuilderTypeFor(ConstraintSystem &cs,
// Find the opened type for this callee and substitute in the type
// parameters.
auto substitutions = cs.getOpenedTypes(calleeLocator);
if (!substitutions.empty()) {
OpenedTypeMap replacements(substitutions.begin(), substitutions.end());
builderType = cs.openType(builderType, replacements, locator);
}
if (!substitutions.empty())
builderType = cs.openType(builderType, substitutions, locator);
assert(!builderType->hasTypeParameter());
}
return builderType;