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