We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
KeyPathExpr
1 parent bcec7ee commit 1a65455Copy full SHA for 1a65455
1 file changed
swift/extractor/translators/ExprTranslator.cpp
@@ -379,12 +379,7 @@ codeql::KeyPathExpr ExprTranslator::translateKeyPathExpr(const swift::KeyPathExp
379
entry.components.push_back(emitKeyPathComponent(component));
380
}
381
if (auto rootTypeRepr = expr.getExplicitRootType()) {
382
- auto keyPathType = expr.getType()->getAs<swift::BoundGenericClassType>();
383
- CODEQL_EXPECT_OR(return entry, keyPathType, "KeyPathExpr must have BoundGenericClassType");
384
- auto keyPathTypeArgs = keyPathType->getGenericArgs();
385
- CODEQL_EXPECT_OR(return entry, keyPathTypeArgs.size() != 0,
386
- "KeyPathExpr type must have generic args");
387
- entry.root = dispatcher.fetchLabel(rootTypeRepr, keyPathTypeArgs[0]);
+ entry.root = dispatcher.fetchLabel(rootTypeRepr, expr.getRootType());
388
389
390
return entry;
0 commit comments