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) {
1179
1179
1180
1180
D->getAttrs ().print (Printer, Options, D);
1181
1181
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
+
1182
1192
// Print the implicit 'final' attribute.
1183
1193
if (auto VD = dyn_cast<ValueDecl>(D)) {
1184
1194
auto VarD = dyn_cast<VarDecl>(D);
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public protocol Wrapped {
46
46
47
47
public protocol OuterWrapped : Wrapped { }
48
48
49
- // CHECK: public struct WithProtocol : TypeWrappers.Wrapped {
49
+ // CHECK: @TypeWrappers.Wrapper public struct WithProtocol : TypeWrappers.Wrapped {
50
50
// CHECK: public var a: Swift.Int {
51
51
// CHECK: get
52
52
// CHECK: set
You can’t perform that action at this time.
0 commit comments