Skip to content

Commit 43f1e9b

Browse files
committed
[CSDiag] NFC: Remove obsolete CalleeListener callback
Since closure handling has been ported to new diagnostic framework `CalleeListener` callback is no longer used.
1 parent 746b58e commit 43f1e9b

File tree

1 file changed

+0
-41
lines changed

1 file changed

+0
-41
lines changed

lib/Sema/CSDiag.cpp

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,47 +1615,6 @@ bool FailureDiagnosis::visitSubscriptExpr(SubscriptExpr *SE) {
16151615
return diagnoseSubscriptErrors(SE, /* inAssignmentDestination = */ false);
16161616
}
16171617

1618-
namespace {
1619-
/// Type checking listener for pattern binding initializers.
1620-
class CalleeListener : public ExprTypeCheckListener {
1621-
Type contextualType;
1622-
public:
1623-
explicit CalleeListener(Type contextualType)
1624-
: contextualType(contextualType) { }
1625-
1626-
bool builtConstraints(ConstraintSystem &cs, Expr *expr) override {
1627-
// If we have no contextual type, there is nothing to do.
1628-
if (!contextualType)
1629-
return false;
1630-
1631-
// If the expression is obviously something that produces a metatype,
1632-
// then don't put a constraint on it.
1633-
auto semExpr = expr->getValueProvidingExpr();
1634-
if (isa<TypeExpr>(semExpr))
1635-
return false;
1636-
1637-
auto resultLocator =
1638-
cs.getConstraintLocator(expr, ConstraintLocator::FunctionResult);
1639-
auto resultType = cs.createTypeVariable(resultLocator,
1640-
TVO_CanBindToLValue |
1641-
TVO_CanBindToNoEscape);
1642-
1643-
auto locator = cs.getConstraintLocator(expr);
1644-
cs.addConstraint(ConstraintKind::FunctionResult,
1645-
cs.getType(expr),
1646-
resultType,
1647-
locator);
1648-
1649-
cs.addConstraint(ConstraintKind::Conversion,
1650-
resultType,
1651-
contextualType,
1652-
locator);
1653-
1654-
return false;
1655-
}
1656-
};
1657-
} // end anonymous namespace
1658-
16591618
// Check if there is a structural problem in the function expression
16601619
// by performing type checking with the option to allow unresolved
16611620
// type variables. If that is going to produce a function type with

0 commit comments

Comments
 (0)