@@ -6560,7 +6560,10 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6560
6560
6561
6561
auto *typeAliasDecl = T->getDecl ();
6562
6562
if (typeAliasDecl->isGeneric ()) {
6563
- printGenericArgs (T->getExpandedGenericArgs ());
6563
+ if (Options.PrintTypesForDebugging )
6564
+ printGenericArgs (T->getDirectGenericArgs ());
6565
+ else
6566
+ printGenericArgs (T->getExpandedGenericArgs ());
6564
6567
}
6565
6568
}
6566
6569
@@ -6571,7 +6574,7 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6571
6574
}
6572
6575
6573
6576
void visitPackType (PackType *T) {
6574
- if (Options.PrintExplicitPackTypes )
6577
+ if (Options.PrintExplicitPackTypes || Options. PrintTypesForDebugging )
6575
6578
Printer << " Pack{" ;
6576
6579
6577
6580
auto Fields = T->getElementTypes ();
@@ -6582,7 +6585,7 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6582
6585
visit (EltType);
6583
6586
}
6584
6587
6585
- if (Options.PrintExplicitPackTypes )
6588
+ if (Options.PrintExplicitPackTypes || Options. PrintTypesForDebugging )
6586
6589
Printer << " }" ;
6587
6590
}
6588
6591
@@ -6607,7 +6610,8 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6607
6610
6608
6611
if (rootParameterPacks.empty () &&
6609
6612
(T->getCountType ()->isParameterPack () ||
6610
- T->getCountType ()->is <PackArchetypeType>())) {
6613
+ T->getCountType ()->is <PackArchetypeType>() ||
6614
+ Options.PrintTypesForDebugging )) {
6611
6615
Printer << " /* shape: " ;
6612
6616
visit (T->getCountType ());
6613
6617
Printer << " */ " ;
@@ -6682,7 +6686,10 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
6682
6686
}
6683
6687
printQualifiedType (T);
6684
6688
6685
- printGenericArgs (T->getExpandedGenericArgs ());
6689
+ if (Options.PrintTypesForDebugging )
6690
+ printGenericArgs (T->getGenericArgs ());
6691
+ else
6692
+ printGenericArgs (T->getExpandedGenericArgs ());
6686
6693
}
6687
6694
6688
6695
void visitParentType (Type T) {
0 commit comments