[ConstraintSystem] Don't contract edges with type holes

Holes couldn't be contracted instead solving of the constraint
has to be delayed until one of the sides is bound to a type,
otherwise there is a risk to loose contextual information.
This commit is contained in:
Pavel Yaskevich
2020-05-15 00:11:30 -07:00
parent f68e8d2436
commit 2f91f213ec

View File

@@ -1126,6 +1126,10 @@ bool ConstraintGraph::contractEdges() {
if (isParamBindingConstraint && tyvar1->getImpl().canBindToInOut()) {
bool isNotContractable = true;
if (auto bindings = CS.getPotentialBindings(tyvar1)) {
// Holes can't be contracted.
if (bindings.IsHole)
continue;
for (auto &binding : bindings.Bindings) {
auto type = binding.BindingType;
isNotContractable = type.findIf([&](Type nestedType) -> bool {