Skip to content

Commit 6261324

Browse files
authored
Merge pull request #28980 from xedin/remove-obsolete-csdiag-listener
[CSDiag] NFC: Remove obsolete `CalleeListener` callback
2 parents e71782a + 43f1e9b commit 6261324

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
@@ -1570,47 +1570,6 @@ bool FailureDiagnosis::visitSubscriptExpr(SubscriptExpr *SE) {
15701570
return diagnoseSubscriptErrors(SE, /* inAssignmentDestination = */ false);
15711571
}
15721572

1573-
namespace {
1574-
/// Type checking listener for pattern binding initializers.
1575-
class CalleeListener : public ExprTypeCheckListener {
1576-
Type contextualType;
1577-
public:
1578-
explicit CalleeListener(Type contextualType)
1579-
: contextualType(contextualType) { }
1580-
1581-
bool builtConstraints(ConstraintSystem &cs, Expr *expr) override {
1582-
// If we have no contextual type, there is nothing to do.
1583-
if (!contextualType)
1584-
return false;
1585-
1586-
// If the expression is obviously something that produces a metatype,
1587-
// then don't put a constraint on it.
1588-
auto semExpr = expr->getValueProvidingExpr();
1589-
if (isa<TypeExpr>(semExpr))
1590-
return false;
1591-
1592-
auto resultLocator =
1593-
cs.getConstraintLocator(expr, ConstraintLocator::FunctionResult);
1594-
auto resultType = cs.createTypeVariable(resultLocator,
1595-
TVO_CanBindToLValue |
1596-
TVO_CanBindToNoEscape);
1597-
1598-
auto locator = cs.getConstraintLocator(expr);
1599-
cs.addConstraint(ConstraintKind::FunctionResult,
1600-
cs.getType(expr),
1601-
resultType,
1602-
locator);
1603-
1604-
cs.addConstraint(ConstraintKind::Conversion,
1605-
resultType,
1606-
contextualType,
1607-
locator);
1608-
1609-
return false;
1610-
}
1611-
};
1612-
} // end anonymous namespace
1613-
16141573
// Check if there is a structural problem in the function expression
16151574
// by performing type checking with the option to allow unresolved
16161575
// type variables. If that is going to produce a function type with

0 commit comments

Comments
 (0)