Skip to content

Commit 37b9a69

Browse files
author
Amritpan Kaur
committed
[ConstraintLocator] Add key path component lookup
1 parent 594469a commit 37b9a69

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/Sema/ConstraintLocator.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ class ConstraintLocator : public llvm::FoldingSetNode {
275275
/// a key path component.
276276
bool isForKeyPathComponentResult() const;
277277

278+
/// Determine whether this locator points to a key path component.
279+
bool isForKeyPathComponent() const;
280+
278281
/// Determine whether this locator points to the generic parameter.
279282
bool isForGenericParameter() const;
280283

lib/Sema/ConstraintLocator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,10 @@ bool ConstraintLocator::isForKeyPathComponentResult() const {
598598
return isLastElement<LocatorPathElt::KeyPathComponentResult>();
599599
}
600600

601+
bool ConstraintLocator::isForKeyPathComponent() const {
602+
return isLastElement<LocatorPathElt::KeyPathComponent>();
603+
}
604+
601605
bool ConstraintLocator::isForGenericParameter() const {
602606
return isLastElement<LocatorPathElt::GenericParameter>();
603607
}

0 commit comments

Comments
 (0)