mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[cssimplify] add a fix for contextual type conversion for function type
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user