File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2107,11 +2107,17 @@ void PrintAST::printExtension(ExtensionDecl *decl) {
2107
2107
recordDeclLoc (decl, [&]{
2108
2108
// We cannot extend sugared types.
2109
2109
Type extendedType = decl->getExtendedType ();
2110
- if (!extendedType || !extendedType-> getAnyNominal () ) {
2110
+ if (!extendedType) {
2111
2111
// Fallback to TypeRepr.
2112
2112
printTypeLoc (decl->getExtendedTypeRepr ());
2113
2113
return ;
2114
2114
}
2115
+ if (!extendedType->getAnyNominal ()) {
2116
+ // Fallback to the type. This usually means we're trying to print an
2117
+ // UnboundGenericType.
2118
+ printTypeLoc (TypeLoc::withoutLoc (extendedType));
2119
+ return ;
2120
+ }
2115
2121
printExtendedTypeName (extendedType, Printer, Options);
2116
2122
});
2117
2123
printInherited (decl);
You can’t perform that action at this time.
0 commit comments