Skip to content

Commit a9321d0

Browse files
committed
[nfc] add variadic is for types
1 parent e8709d1 commit a9321d0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/AST/Types.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,11 @@ class alignas(1 << TypeAlignInBits) TypeBase
614614
static_assert(!isSugaredType<T>(), "isa desugars types");
615615
return isa<T>(getDesugaredType());
616616
}
617+
618+
template <typename First, typename Second, typename... Rest>
619+
bool is() {
620+
return is<First>() || is<Second, Rest...>();
621+
}
617622

618623
template <typename T>
619624
T *castTo() {

0 commit comments

Comments
 (0)