mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Record parameter bindings in solutions (NFC)
This saves us from needing to re-match args to params in CSApply and is also useful for a forthcoming change migrating code completion in argument position to use the solver-based typeCheckForCodeCompletion api. rdar://76581093
This commit is contained in:
@@ -3065,6 +3065,16 @@ Type ConstraintSystem::simplifyType(Type type) const {
|
||||
});
|
||||
}
|
||||
|
||||
void Solution::recordSingleArgMatchingChoice(ConstraintLocator *locator) {
|
||||
auto &cs = getConstraintSystem();
|
||||
assert(argumentMatchingChoices.find(locator) ==
|
||||
argumentMatchingChoices.end() &&
|
||||
"recording multiple bindings for same locator");
|
||||
argumentMatchingChoices.insert(
|
||||
{cs.getConstraintLocator(locator, ConstraintLocator::ApplyArgument),
|
||||
MatchCallArgumentResult::forArity(1)});
|
||||
}
|
||||
|
||||
Type Solution::simplifyType(Type type) const {
|
||||
if (!(type->hasTypeVariable() || type->hasPlaceholder()))
|
||||
return type;
|
||||
|
||||
Reference in New Issue
Block a user