We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7f2c262 commit fe3216aCopy full SHA for fe3216a
include/swift/AST/Expr.h
@@ -5833,7 +5833,10 @@ class KeyPathExpr : public Expr {
5833
/// Indicates if the key path expression is composed by a single invalid
5834
/// component. e.g. missing component `\Root`
5835
bool hasSingleInvalidComponent() const {
5836
- return Components.size() == 1 && !Components.front().isValid();
+ if (ParsedRoot && ParsedRoot->getKind() == ExprKind::Type) {
5837
+ return Components.size() == 1 && !Components.front().isValid();
5838
+ }
5839
+ return false;
5840
}
5841
5842
/// Retrieve the string literal expression, which will be \c NULL prior to
0 commit comments