@@ -1758,28 +1758,13 @@ void PrintAST::visitImportDecl(ImportDecl *decl) {
1758
1758
1759
1759
static void printExtendedTypeName (Type ExtendedType, ASTPrinter &Printer,
1760
1760
PrintOptions Options) {
1761
- auto Nominal = ExtendedType->getAnyNominal ();
1762
- assert (Nominal && " extension of non-nominal type" );
1763
- if (auto nt = ExtendedType->getAs <NominalType>()) {
1764
- if (auto ParentType = nt->getParent ()) {
1765
- if (auto *ParentNT = ParentType->getAs <NominalOrBoundGenericNominalType>()) {
1766
- // Avoid using the parent type directly because it can be bound
1767
- // generic type and sugared.
1768
- ParentNT->getDecl ()->getDeclaredType ().print (Printer, Options);
1769
- } else {
1770
- ParentType.print (Printer, Options);
1771
- }
1772
- Printer << " ." ;
1773
- }
1774
- }
1761
+ Options.FullyQualifiedTypes = false ;
1762
+ Options.FullyQualifiedTypesIfAmbiguous = false ;
1775
1763
1776
- // Respect alias type.
1777
- if (isa<NameAliasType>(ExtendedType.getPointer ())) {
1778
- ExtendedType.print (Printer, Options);
1779
- return ;
1780
- }
1764
+ // Strip off generic arguments, if any.
1765
+ auto Ty = ExtendedType->getAnyNominal ()->getDeclaredType ();
1781
1766
1782
- Printer. printTypeRef (ExtendedType, Nominal, Nominal-> getName () );
1767
+ Ty-> print (Printer, Options );
1783
1768
}
1784
1769
1785
1770
void PrintAST::printSynthesizedExtension (Type ExtendedType,
0 commit comments