Skip to content

Commit 4c7e889

Browse files
committed
Sema: isPassThroughTypealias() is only used in one file
1 parent ef82cd7 commit 4c7e889

File tree

2 files changed

+19
-21
lines changed

2 files changed

+19
-21
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4689,7 +4689,25 @@ void TypeChecker::finalizeDecl(ValueDecl *decl) {
46894689
(void)decl->isDynamic();
46904690
}
46914691

4692-
bool swift::isPassThroughTypealias(TypeAliasDecl *typealias) {
4692+
/// Determine whether this is a "pass-through" typealias, which has the
4693+
/// same type parameters as the nominal type it references and specializes
4694+
/// the underlying nominal type with exactly those type parameters.
4695+
/// For example, the following typealias \c GX is a pass-through typealias:
4696+
///
4697+
/// \code
4698+
/// struct X<T, U> { }
4699+
/// typealias GX<A, B> = X<A, B>
4700+
/// \endcode
4701+
///
4702+
/// whereas \c GX2 and \c GX3 are not pass-through because \c GX2 has
4703+
/// different type parameters and \c GX3 doesn't pass its type parameters
4704+
/// directly through.
4705+
///
4706+
/// \code
4707+
/// typealias GX2<A> = X<A, A>
4708+
/// typealias GX3<A, B> = X<B, A>
4709+
/// \endcode
4710+
static bool isPassThroughTypealias(TypeAliasDecl *typealias) {
46934711
// Pass-through only makes sense when the typealias refers to a nominal
46944712
// type.
46954713
Type underlyingType = typealias->getUnderlyingTypeLoc().getType();

lib/Sema/TypeChecker.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2171,26 +2171,6 @@ bool isAcceptableDynamicMemberLookupSubscript(SubscriptDecl *decl,
21712171
DeclContext *DC,
21722172
TypeChecker &TC);
21732173

2174-
/// Determine whether this is a "pass-through" typealias, which has the
2175-
/// same type parameters as the nominal type it references and specializes
2176-
/// the underlying nominal type with exactly those type parameters.
2177-
/// For example, the following typealias \c GX is a pass-through typealias:
2178-
///
2179-
/// \code
2180-
/// struct X<T, U> { }
2181-
/// typealias GX<A, B> = X<A, B>
2182-
/// \endcode
2183-
///
2184-
/// whereas \c GX2 and \c GX3 are not pass-through because \c GX2 has
2185-
/// different type parameters and \c GX3 doesn't pass its type parameters
2186-
/// directly through.
2187-
///
2188-
/// \code
2189-
/// typealias GX2<A> = X<A, A>
2190-
/// typealias GX3<A, B> = X<B, A>
2191-
/// \endcode
2192-
bool isPassThroughTypealias(TypeAliasDecl *typealias);
2193-
21942174
/// Whether an overriding declaration requires the 'override' keyword.
21952175
enum class OverrideRequiresKeyword {
21962176
/// The keyword is never required.

0 commit comments

Comments
 (0)