Skip to content

Commit 594469a

Browse files
authored
Merge pull request #68013 from xedin/fix-directlyAt-in-locator-builder
[ConstraintSystem] Fix locator builder `directlyAt`
2 parents 05d77fa + d6853c2 commit 594469a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/Sema/ConstraintLocator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,11 +1264,11 @@ class ConstraintLocatorBuilder {
12641264
template <typename E>
12651265
bool directlyAt() const {
12661266
if (auto *expr = getAnchor().dyn_cast<Expr *>())
1267-
return isa<E>(expr) && hasEmptyPath();
1267+
return isa<E>(expr) && !last();
12681268
return false;
12691269
}
12701270

1271-
/// Determine whether this builder has an empty path.
1271+
/// Determine whether this builder has an empty path (no new elements).
12721272
bool hasEmptyPath() const {
12731273
return !element;
12741274
}

0 commit comments

Comments
 (0)