Skip to content

Commit c20532e

Browse files
committed
AST: Move TypeBase::isParameterPack() to ParameterPack.cpp
1 parent 5e7a91d commit c20532e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

include/swift/AST/Types.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7098,16 +7098,6 @@ inline bool TypeBase::isTypeParameter() {
70987098
return t->is<GenericTypeParamType>();
70997099
}
71007100

7101-
inline bool TypeBase::isParameterPack() {
7102-
Type t(this);
7103-
7104-
while (auto *memberTy = t->getAs<DependentMemberType>())
7105-
t = memberTy->getBase();
7106-
7107-
return t->is<GenericTypeParamType>() &&
7108-
t->castTo<GenericTypeParamType>()->isParameterPack();
7109-
}
7110-
71117101
// TODO: This will become redundant once InOutType is removed.
71127102
inline bool TypeBase::isMaterializable() {
71137103
return !(hasLValueType() || is<InOutType>());

lib/AST/ParameterPack.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ bool GenericTypeParamType::isParameterPack() const {
9090
GenericTypeParamType::TYPE_SEQUENCE_BIT;
9191
}
9292

93+
bool TypeBase::isParameterPack() {
94+
Type t(this);
95+
96+
while (auto *memberTy = t->getAs<DependentMemberType>())
97+
t = memberTy->getBase();
98+
99+
return t->is<GenericTypeParamType>() &&
100+
t->castTo<GenericTypeParamType>()->isParameterPack();
101+
}
102+
93103
PackType *TypeBase::getPackSubstitutionAsPackType() {
94104
if (auto pack = getAs<PackType>()) {
95105
return pack;

0 commit comments

Comments
 (0)