Skip to content

Commit d587954

Browse files
committed
AST: Move TypeBase::isParameterPack() to ParameterPack.cpp
1 parent 3ef5cd1 commit d587954

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
@@ -7093,16 +7093,6 @@ inline bool TypeBase::isTypeParameter() {
70937093
return t->is<GenericTypeParamType>();
70947094
}
70957095

7096-
inline bool TypeBase::isParameterPack() {
7097-
Type t(this);
7098-
7099-
while (auto *memberTy = t->getAs<DependentMemberType>())
7100-
t = memberTy->getBase();
7101-
7102-
return t->is<GenericTypeParamType>() &&
7103-
t->castTo<GenericTypeParamType>()->isParameterPack();
7104-
}
7105-
71067096
// TODO: This will become redundant once InOutType is removed.
71077097
inline bool TypeBase::isMaterializable() {
71087098
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)