@@ -1173,8 +1173,8 @@ namespace {
1173
1173
if (cs.getType (base)->is <LValueType>())
1174
1174
selfParamTy = InOutType::get (selfTy);
1175
1175
1176
- base = coerceObjectArgumentToType (
1177
- base, selfParamTy, member, semantics,
1176
+ base = coerceSelfArgumentToType (
1177
+ base, selfParamTy, member,
1178
1178
locator.withPathElement (ConstraintLocator::MemberRefBase));
1179
1179
} else {
1180
1180
if (!isExistentialMetatype || openedExistential) {
@@ -1587,7 +1587,7 @@ namespace {
1587
1587
ArrayRef<Identifier> argLabels,
1588
1588
ConstraintLocatorBuilder locator);
1589
1589
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
1591
1591
// / member expression) to the given type.
1592
1592
// /
1593
1593
// / \param expr The expression to coerce.
@@ -1596,13 +1596,10 @@ namespace {
1596
1596
// /
1597
1597
// / \param member The member being accessed.
1598
1598
// /
1599
- // / \param semantics The kind of access we've been asked to perform.
1600
- // /
1601
1599
// / \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);
1606
1603
1607
1604
private:
1608
1605
// / Build a new subscript.
@@ -1806,8 +1803,7 @@ namespace {
1806
1803
// Handle dynamic lookup.
1807
1804
if (choice.getKind () == OverloadChoiceKind::DeclViaDynamic ||
1808
1805
subscript->getAttrs ().hasAttribute <OptionalAttr>()) {
1809
- base = coerceObjectArgumentToType (base, baseTy, subscript,
1810
- AccessSemantics::Ordinary, locator);
1806
+ base = coerceSelfArgumentToType (base, baseTy, subscript, locator);
1811
1807
if (!base)
1812
1808
return nullptr ;
1813
1809
@@ -1831,8 +1827,8 @@ namespace {
1831
1827
auto containerTy = solution.simplifyType (openedBaseType);
1832
1828
1833
1829
if (baseIsInstance) {
1834
- base = coerceObjectArgumentToType (
1835
- base, containerTy, subscript, AccessSemantics::Ordinary,
1830
+ base = coerceSelfArgumentToType (
1831
+ base, containerTy, subscript,
1836
1832
locator.withPathElement (ConstraintLocator::MemberRefBase));
1837
1833
} else {
1838
1834
base = coerceToType (base,
@@ -6869,7 +6865,6 @@ static bool isNonMutatingSetterPWAssignInsideInit(Expr *baseExpr,
6869
6865
// / the given member.
6870
6866
static Type adjustSelfTypeForMember (Expr *baseExpr,
6871
6867
Type baseTy, ValueDecl *member,
6872
- AccessSemantics semantics,
6873
6868
DeclContext *UseDC) {
6874
6869
assert (!baseTy->is <LValueType>());
6875
6870
@@ -6916,11 +6911,10 @@ static Type adjustSelfTypeForMember(Expr *baseExpr,
6916
6911
}
6917
6912
6918
6913
Expr *
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);
6924
6918
6925
6919
// If our expression already has the right type, we're done.
6926
6920
Type fromType = cs.getType (expr);
0 commit comments