Skip to content

Commit b5f89cf

Browse files
committed
[TypeChecker] User interface type while validating keypath dynamic subscript parameter
Avoid unnecessary parameter type substitutions.
1 parent f7ee402 commit b5f89cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckAttr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ bool swift::isValidKeyPathDynamicMemberLookup(SubscriptDecl *decl,
12071207
return false;
12081208

12091209
const auto *param = decl->getIndices()->get(0);
1210-
if (auto NTD = param->getType()->getAnyNominal()) {
1210+
if (auto NTD = param->getInterfaceType()->getAnyNominal()) {
12111211
return NTD == ctx.getKeyPathDecl() ||
12121212
NTD == ctx.getWritableKeyPathDecl() ||
12131213
NTD == ctx.getReferenceWritableKeyPathDecl();

0 commit comments

Comments
 (0)