Skip to content

Commit 0b0dfe8

Browse files
authored
Merge pull request swiftlang#28764 from hborla/remove-unused-func-csdiag
[CSDiag] Remove diagnoseClosureExplicitParameterMismatch.
2 parents bb1052c + 5ec28a6 commit 0b0dfe8

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,39 +1675,6 @@ namespace {
16751675
};
16761676
} // end anonymous namespace
16771677

1678-
static bool diagnoseClosureExplicitParameterMismatch(
1679-
ConstraintSystem &CS, SourceLoc loc,
1680-
ArrayRef<AnyFunctionType::Param> params,
1681-
ArrayRef<AnyFunctionType::Param> args) {
1682-
// We are not trying to diagnose structural problems with top-level
1683-
// arguments here.
1684-
if (params.size() != args.size())
1685-
return false;
1686-
1687-
for (unsigned i = 0, n = params.size(); i != n; ++i) {
1688-
auto paramType = params[i].getOldType();
1689-
auto argType = args[i].getOldType();
1690-
1691-
if (auto paramFnType = paramType->getAs<AnyFunctionType>()) {
1692-
if (auto argFnType = argType->getAs<AnyFunctionType>())
1693-
return diagnoseClosureExplicitParameterMismatch(
1694-
CS, loc, paramFnType->getParams(), argFnType->getParams());
1695-
}
1696-
1697-
if (!paramType || !argType || isUnresolvedOrTypeVarType(paramType) ||
1698-
isUnresolvedOrTypeVarType(argType))
1699-
continue;
1700-
1701-
if (!TypeChecker::isConvertibleTo(argType, paramType, CS.DC)) {
1702-
CS.getASTContext().Diags.diagnose(loc, diag::types_not_convertible,
1703-
false, paramType, argType);
1704-
return true;
1705-
}
1706-
}
1707-
1708-
return false;
1709-
}
1710-
17111678
/// Check if there failure associated with expression is related
17121679
/// to given contextual type.
17131680
bool FailureDiagnosis::diagnoseCallContextualConversionErrors(

0 commit comments

Comments
 (0)