File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1179,6 +1179,16 @@ void PrintAST::printAttributes(const Decl *D) {
11791179
11801180 D->getAttrs ().print (Printer, Options, D);
11811181
1182+ // We need to check whether this is a type with an inferred
1183+ // type wrapper attribute and if so print it explicitly.
1184+ if (auto *NTD = dyn_cast<NominalTypeDecl>(D)) {
1185+ auto typeWrapperInfo = NTD->getTypeWrapper ();
1186+ // The attribute has been inferred and we have to print it.
1187+ if (typeWrapperInfo && typeWrapperInfo->IsInferred ) {
1188+ typeWrapperInfo->Attr ->print (Printer, Options, D);
1189+ }
1190+ }
1191+
11821192 // Print the implicit 'final' attribute.
11831193 if (auto VD = dyn_cast<ValueDecl>(D)) {
11841194 auto VarD = dyn_cast<VarDecl>(D);
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public protocol Wrapped {
4646
4747public protocol OuterWrapped : Wrapped { }
4848
49- // CHECK: public struct WithProtocol : TypeWrappers.Wrapped {
49+ // CHECK: @TypeWrappers.Wrapper public struct WithProtocol : TypeWrappers.Wrapped {
5050// CHECK: public var a: Swift.Int {
5151// CHECK: get
5252// CHECK: set
You can’t perform that action at this time.
0 commit comments