Skip to content

Commit 7aed970

Browse files
committed
[ConstraintLocator] Add is convenience method to simplify check for kind of implicit conversion
1 parent 8c60176 commit 7aed970

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/Sema/ConstraintLocator.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,10 @@ class LocatorPathElt::ImplicitConversion final
813813
return static_cast<ConversionRestrictionKind>(getValue());
814814
}
815815

816+
bool is(ConversionRestrictionKind kind) const {
817+
return getConversionKind() == kind;
818+
}
819+
816820
static bool classof(const LocatorPathElt *elt) {
817821
return elt->getKind() == ConstraintLocator::ImplicitConversion;
818822
}

0 commit comments

Comments
 (0)