@@ -1173,8 +1173,8 @@ namespace {
11731173 if (cs.getType (base)->is <LValueType>())
11741174 selfParamTy = InOutType::get (selfTy);
11751175
1176- base = coerceObjectArgumentToType (
1177- base, selfParamTy, member, semantics,
1176+ base = coerceSelfArgumentToType (
1177+ base, selfParamTy, member,
11781178 locator.withPathElement (ConstraintLocator::MemberRefBase));
11791179 } else {
11801180 if (!isExistentialMetatype || openedExistential) {
@@ -1587,7 +1587,7 @@ namespace {
15871587 ArrayRef<Identifier> argLabels,
15881588 ConstraintLocatorBuilder locator);
15891589
1590- // / Coerce the given object argument (e.g., for the base of a
1590+ // / Coerce the given 'self' argument (e.g., for the base of a
15911591 // / member expression) to the given type.
15921592 // /
15931593 // / \param expr The expression to coerce.
@@ -1596,13 +1596,10 @@ namespace {
15961596 // /
15971597 // / \param member The member being accessed.
15981598 // /
1599- // / \param semantics The kind of access we've been asked to perform.
1600- // /
16011599 // / \param locator Locator used to describe where in this expression we are.
1602- Expr *coerceObjectArgumentToType (Expr *expr,
1603- Type baseTy, ValueDecl *member,
1604- AccessSemantics semantics,
1605- ConstraintLocatorBuilder locator);
1600+ Expr *coerceSelfArgumentToType (Expr *expr,
1601+ Type baseTy, ValueDecl *member,
1602+ ConstraintLocatorBuilder locator);
16061603
16071604 private:
16081605 // / Build a new subscript.
@@ -1806,8 +1803,7 @@ namespace {
18061803 // Handle dynamic lookup.
18071804 if (choice.getKind () == OverloadChoiceKind::DeclViaDynamic ||
18081805 subscript->getAttrs ().hasAttribute <OptionalAttr>()) {
1809- base = coerceObjectArgumentToType (base, baseTy, subscript,
1810- AccessSemantics::Ordinary, locator);
1806+ base = coerceSelfArgumentToType (base, baseTy, subscript, locator);
18111807 if (!base)
18121808 return nullptr ;
18131809
@@ -1831,8 +1827,8 @@ namespace {
18311827 auto containerTy = solution.simplifyType (openedBaseType);
18321828
18331829 if (baseIsInstance) {
1834- base = coerceObjectArgumentToType (
1835- base, containerTy, subscript, AccessSemantics::Ordinary,
1830+ base = coerceSelfArgumentToType (
1831+ base, containerTy, subscript,
18361832 locator.withPathElement (ConstraintLocator::MemberRefBase));
18371833 } else {
18381834 base = coerceToType (base,
@@ -6869,7 +6865,6 @@ static bool isNonMutatingSetterPWAssignInsideInit(Expr *baseExpr,
68696865// / the given member.
68706866static Type adjustSelfTypeForMember (Expr *baseExpr,
68716867 Type baseTy, ValueDecl *member,
6872- AccessSemantics semantics,
68736868 DeclContext *UseDC) {
68746869 assert (!baseTy->is <LValueType>());
68756870
@@ -6916,11 +6911,10 @@ static Type adjustSelfTypeForMember(Expr *baseExpr,
69166911}
69176912
69186913Expr *
6919- ExprRewriter::coerceObjectArgumentToType (Expr *expr,
6920- Type baseTy, ValueDecl *member,
6921- AccessSemantics semantics,
6922- ConstraintLocatorBuilder locator) {
6923- Type toType = adjustSelfTypeForMember (expr, baseTy, member, semantics, dc);
6914+ ExprRewriter::coerceSelfArgumentToType (Expr *expr,
6915+ Type baseTy, ValueDecl *member,
6916+ ConstraintLocatorBuilder locator) {
6917+ Type toType = adjustSelfTypeForMember (expr, baseTy, member, dc);
69246918
69256919 // If our expression already has the right type, we're done.
69266920 Type fromType = cs.getType (expr);
0 commit comments