[cssimplify] add a fix for contextual type conversion for function type

This commit is contained in:
Suyash Srijan
2019-03-22 23:40:43 +00:00
parent cad60ba08b
commit 1b62039c76
3 changed files with 57 additions and 58 deletions

View File

@@ -1989,6 +1989,17 @@ repairFailures(ConstraintSystem &cs, Type lhs, Type rhs,
break;
}
case ConstraintLocator::ContextualType: {
if (lhs->is<FunctionType>() && !rhs->is<AnyFunctionType>()) {
auto *fix = ContextualMismatch::create(cs, lhs, rhs,
cs.getConstraintLocator(locator));
conversionsOrFixes.push_back(fix);
break;
}
return;
}
default:
return;
}