Skip to content

Commit 5a5e655

Browse files
committed
ModulePrinting: Removing the comments that indicate an extension is synthesized; we will make the difference clear by using different syntax colors.
1 parent bc1fc73 commit 5a5e655

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1905,7 +1905,6 @@ static void printExtendedTypeName(Type ExtendedType, ASTPrinter &Printer,
19051905
void PrintAST::
19061906
printSynthesizedExtension(NominalTypeDecl* Decl, ExtensionDecl *ExtDecl) {
19071907
if (Options.TransformContext->shouldOpenExtension) {
1908-
Printer << "// synthesized\n";
19091908
printDocumentationComment(ExtDecl);
19101909
printAttributes(ExtDecl);
19111910
Printer << tok::kw_extension << " ";

test/IDE/print_synthesized_extensions.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,30 +123,30 @@ public struct S10 : P1 {
123123
}
124124
}
125125

126-
// CHECK: <synthesized>// synthesized
126+
// CHECK: <synthesized>
127127
// CHECK: extension <ref:Struct>S1</ref> where T : P2 {
128128
// CHECK: <decl:Func>public func <loc>p2member()</loc></decl></synthesized>
129129
// CHECK: <synthesized>
130130
// CHECK: <decl:Func>public func <loc>ef1(<decl:Param>t: T</decl>)</loc></decl>
131131
// CHECK: <decl:Func>public func <loc>ef2(<decl:Param>t: <ref:Struct>S2</ref></decl>)</loc></decl>
132132
// CHECK: }</synthesized>
133133

134-
// CHECK: <synthesized>// synthesized
134+
// CHECK: <synthesized>
135135
// CHECK: extension <ref:Struct>S1</ref> where T : P3 {
136136
// CHECK: <decl:Func>public func <loc>p3Func(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl>
137137
// CHECK: }</synthesized>
138138

139-
// CHECK: <synthesized>// synthesized
139+
// CHECK: <synthesized>
140140
// CHECK: extension <ref:Struct>S1</ref> where T == Int {
141141
// CHECK: <decl:Func>public func <loc>p1IntFunc(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl>
142142
// CHECK: }</synthesized>
143143

144-
// CHECK: <synthesized>// synthesized
144+
// CHECK: <synthesized>
145145
// CHECK: extension <ref:Struct>S1</ref> where T == S9<Int> {
146146
// CHECK: <decl:Func>public func <loc>S9IntFunc()</loc></decl>
147147
// CHECK: }</synthesized>
148148

149-
// CHECK: <synthesized>// synthesized
149+
// CHECK: <synthesized>
150150
// CHECK: extension <ref:Struct>S10</ref> {
151151
// CHECK: <decl:Func>public func <loc>p3Func(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl></synthesized>
152152
// CHECK: <synthesized>
@@ -155,19 +155,19 @@ public struct S10 : P1 {
155155
// CHECK: <decl:Func>public func <loc>S9IntFunc()</loc></decl>
156156
// CHECK: }</synthesized>
157157

158-
// CHECK: <synthesized>// synthesized
158+
// CHECK: <synthesized>
159159
// CHECK: extension <ref:Struct>S4</ref> {
160160
// CHECK: <decl:Func>public func <loc>p1IntFunc(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl>
161161
// CHECK: }</synthesized>
162162

163-
// CHECK: <synthesized>// synthesized
163+
// CHECK: <synthesized>
164164
// CHECK: extension <ref:Struct>S6</ref> {
165165
// CHECK: <decl:Func>public func <loc>p3Func(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl></synthesized>
166166
// CHECK: <synthesized>
167167
// CHECK: <decl:Func>public func <loc>ef5(<decl:Param>t: <ref:Struct>S5</ref></decl>)</loc></decl>
168168
// CHECK: }</synthesized>
169169

170-
// CHECK: <synthesized>// synthesized
170+
// CHECK: <synthesized>
171171
// CHECK: extension <ref:module>print_synthesized_extensions</ref>.<ref:Struct>S7</ref>.<ref:Struct>S8</ref> {
172172
// CHECK: <decl:Func>public func <loc>p3Func(<decl:Param>i: <ref:Struct>Int</ref></decl>)</loc> -> <ref:Struct>Int</ref></decl></synthesized>
173173
// CHECK: <synthesized>

0 commit comments

Comments
 (0)