mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Adjust TypeBase::getTypeVariables to accept a set
Currently the pattern is to collect the type variables and then unique them. Instead of asking clients to do uniquing, let's just accept a set as an argument.
This commit is contained in:
@@ -10549,13 +10549,16 @@ ConstraintSystem::addArgumentConversionConstraintImpl(
|
||||
if (auto *argTypeVar = first->getAs<TypeVariableType>()) {
|
||||
if (argTypeVar->getImpl().isClosureType()) {
|
||||
// Extract any type variables present in the parameter's result builder.
|
||||
SmallVector<TypeVariableType *, 4> typeVars;
|
||||
SmallPtrSet<TypeVariableType *, 4> typeVars;
|
||||
if (auto builderTy = getOpenedResultBuilderTypeFor(*this, locator))
|
||||
builderTy->getTypeVariables(typeVars);
|
||||
|
||||
SmallVector<TypeVariableType *, 4> referencedVars{typeVars.begin(),
|
||||
typeVars.end()};
|
||||
|
||||
auto *loc = getConstraintLocator(locator);
|
||||
addUnsolvedConstraint(
|
||||
Constraint::create(*this, kind, first, second, loc, typeVars));
|
||||
Constraint::create(*this, kind, first, second, loc, referencedVars));
|
||||
return SolutionKind::Solved;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user