[ConstraintSystem] Extract PotentialBinding and its auxiliary classes into a separate header

Create a new namespace - `swift::constraints::inference` and associate
`PotentialBinding` with it. This way it would be possible for constraint
graph to operate on `PotentialBinding(s)` in the future.
This commit is contained in:
Pavel Yaskevich
2021-01-13 15:03:10 -08:00
parent 10160cbff9
commit afec25271e
5 changed files with 236 additions and 183 deletions

View File

@@ -38,6 +38,7 @@
using namespace swift;
using namespace constraints;
using namespace inference;
#define DEBUG_TYPE "ConstraintSystem"
@@ -5406,7 +5407,7 @@ bool TypeVarBindingProducer::requiresOptionalAdjustment(
return false;
}
ConstraintSystem::PotentialBinding
PotentialBinding
TypeVarBindingProducer::getDefaultBinding(Constraint *constraint) const {
assert(constraint->getKind() == ConstraintKind::Defaultable ||
constraint->getKind() == ConstraintKind::DefaultClosureType);