mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ModuleInterface] Add printing for new attributes
Specially print @_hasMissingDesignatedInitializers and @_inheritsConvenienceInitializers in module interfaces Fixes rdar://51249311
This commit is contained in:
committed by
Robert Widmann
parent
283854a012
commit
511db0c90a
@@ -990,6 +990,22 @@ void PrintAST::printAttributes(const Decl *D) {
|
||||
Printer << " ";
|
||||
}
|
||||
}
|
||||
|
||||
// If the declaration has designated inits that won't be visible to
|
||||
// clients, or if it inherits superclass convenience initializers,
|
||||
// then print those attributes specially.
|
||||
if (auto CD = dyn_cast<ClassDecl>(D)) {
|
||||
if (Options.PrintImplicitAttrs) {
|
||||
if (CD->inheritsSuperclassInitializers()) {
|
||||
Printer.printAttrName("@_inheritsConvenienceInitializers");
|
||||
Printer << " ";
|
||||
}
|
||||
if (CD->hasMissingDesignatedInitializers()) {
|
||||
Printer.printAttrName("@_hasMissingDesignatedInitializers");
|
||||
Printer << " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
D->getAttrs().print(Printer, Options, D);
|
||||
|
||||
Reference in New Issue
Block a user