@@ -1570,47 +1570,6 @@ bool FailureDiagnosis::visitSubscriptExpr(SubscriptExpr *SE) {
1570
1570
return diagnoseSubscriptErrors (SE, /* inAssignmentDestination = */ false );
1571
1571
}
1572
1572
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
-
1614
1573
// Check if there is a structural problem in the function expression
1615
1574
// by performing type checking with the option to allow unresolved
1616
1575
// type variables. If that is going to produce a function type with
0 commit comments