[Function Builders] Teach diagnostics about function builder body

result types in order to properly diagnose requirement failures that
aren't anchored at an expression.
This commit is contained in:
Holly Borla
2020-07-27 18:28:27 -07:00
parent 5e7bafc882
commit 9baca13088
8 changed files with 50 additions and 6 deletions

View File

@@ -7443,10 +7443,9 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
// If there is a function builder to apply, do so now.
if (functionBuilderType) {
auto *calleeLocator = getCalleeLocator(getConstraintLocator(locator));
if (auto result = matchFunctionBuilder(
closure, functionBuilderType, closureType->getResult(),
ConstraintKind::Conversion, calleeLocator, locator)) {
ConstraintKind::Conversion, locator)) {
return result->isSuccess();
}
}