Skip to content

Commit cf09a4e

Browse files
committed
[CSApply] Mark dynamic member lookup subscript expr and its argument as implicit
These expressions are created to model an implicit call to dynamic member lookup endpoint, which means both of them have to be implicit.
1 parent 1fa3846 commit cf09a4e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/Sema/CSApply.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2863,18 +2863,16 @@ namespace {
28632863
auto tupleTy =
28642864
TupleType::get(TupleTypeElt(paramTy, ctx.Id_dynamicMember), ctx);
28652865

2866-
auto loc = nameLoc;
2867-
Expr *index = TupleExpr::create(ctx, loc, argExpr, ctx.Id_dynamicMember,
2868-
loc, loc, /*hasTrailingClosure*/ false,
2869-
/*implicit*/ true);
2866+
Expr *index =
2867+
TupleExpr::createImplicit(ctx, argExpr, ctx.Id_dynamicMember);
28702868
index->setType(tupleTy);
28712869
cs.cacheType(index);
28722870

28732871
// Build and return a subscript that uses this string as the index.
28742872
return buildSubscript(
28752873
base, index, ctx.Id_dynamicMember,
28762874
/*trailingClosure*/ false, cs.getConstraintLocator(expr),
2877-
/*isImplicit*/ false, AccessSemantics::Ordinary, overload);
2875+
/*isImplicit*/ true, AccessSemantics::Ordinary, overload);
28782876
}
28792877

28802878
Type getTypeOfDynamicMemberIndex(const SelectedOverload &overload) {

0 commit comments

Comments
 (0)