Skip to content

Commit c9d665e

Browse files
committed
[ASTPrinter] Print typealias generic parameters
1 parent bf83474 commit c9d665e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1915,6 +1915,8 @@ void PrintAST::visitTypeAliasDecl(TypeAliasDecl *decl) {
19151915
recordDeclLoc(decl,
19161916
[&]{
19171917
Printer.printName(decl->getName());
1918+
}, [&]{ // Signature
1919+
printGenericParams(decl->getGenericParams());
19181920
});
19191921
bool ShouldPrint = true;
19201922
Type Ty;

test/IDE/print_ast_tc_decls.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,3 +1348,9 @@ extension ProtocolToExtend where Self.Assoc == Int {}
13481348
// PASS_PRINT_AST: #elseif
13491349
// PASS_PRINT_AST: #else
13501350
// PASS_PRINT_AST: #endif
1351+
1352+
public struct MyPair<A, B> { var a: A, b: B }
1353+
public typealias MyPairI<B> = MyPair<Int, B>
1354+
// PASS_PRINT_AST: public typealias MyPairI<B> = MyPair<Int, B>
1355+
public typealias MyPairAlias<T, U> = MyPair<T, U>
1356+
// PASS_PRINT_AST: public typealias MyPairAlias<T, U> = MyPair<T, U>

0 commit comments

Comments
 (0)