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 31e4465 commit e1e933cCopy full SHA for e1e933c
include/swift/Sema/ConstraintLocator.h
@@ -1271,6 +1271,15 @@ class ConstraintLocatorBuilder {
1271
return ConstraintLocatorBuilder(this, newElt, newFlags);
1272
}
1273
1274
+ /// Determine whether this locator builder points directly to a
1275
+ /// given expression.
1276
+ template <typename E>
1277
+ bool directlyAt() const {
1278
+ if (auto *expr = getAnchor().dyn_cast<Expr *>())
1279
+ return isa<E>(expr) && hasEmptyPath();
1280
+ return false;
1281
+ }
1282
+
1283
/// Determine whether this builder has an empty path.
1284
bool hasEmptyPath() const {
1285
return !element;
0 commit comments