File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,15 @@ void AttributedTypeRepr::printAttrs(ASTPrinter &Printer,
218
218
Printer.printSimpleAttr (" @autoclosure" ) << " " ;
219
219
if (hasAttr (TAK_escaping))
220
220
Printer.printSimpleAttr (" @escaping" ) << " " ;
221
+
222
+ for (auto customAttr : Attrs.getCustomAttrs ()) {
223
+ Printer.callPrintStructurePre (PrintStructureKind::BuiltinAttribute);
224
+ Printer << " @" ;
225
+ customAttr->getTypeRepr ()->print (Printer, Options);
226
+ Printer.printStructurePost (PrintStructureKind::BuiltinAttribute);
227
+ Printer << " " ;
228
+ }
229
+
221
230
if (hasAttr (TAK_Sendable))
222
231
Printer.printSimpleAttr (" @Sendable" ) << " " ;
223
232
if (hasAttr (TAK_noDerivative))
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ public func takesSendable(
20
20
_ block: @Sendable @escaping ( ) async throws -> Void
21
21
) { }
22
22
23
+ @available ( SwiftStdlib 5 . 5 , * )
24
+ public func takesMainActor(
25
+ _ block: @MainActor @escaping ( ) -> Void
26
+ ) { }
27
+
23
28
// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency -I %t
24
29
25
30
#else
@@ -31,12 +36,13 @@ func callFn() async {
31
36
}
32
37
#endif
33
38
34
- // RUN: %FileCheck %s <%t/Library.swiftinterface
39
+ // RUN: %FileCheck %s < %t/Library.swiftinterface
35
40
// CHECK: // swift-module-flags:{{.*}} -enable-experimental-concurrency
36
41
// CHECK: public func fn() async
37
42
// CHECK: public func reasyncFn(_: () async -> ()) reasync
38
43
// CHECK: public func takesSendable(_ block: @escaping @Sendable () async throws ->
44
+ // CHECK: public func takesMainActor(_ block: @escaping @{{_Concurrency.MainActor|MainActor}} () ->
39
45
40
- // RUN: %target-swift-emit-module-interface(%t/Library .swiftinterface) %s -enable-experimental-concurrency -DLIBRARY -module-name Library -module-interface-preserve-types-as-written
41
- // RUN: %target-swift-typecheck-module-from-interface(%t/Library .swiftinterface) -enable-experimental-concurrency
42
- // RUN: %FileCheck %s <%t/Library .swiftinterface
46
+ // RUN: %target-swift-emit-module-interface(%t/LibraryPreserveTypesAsWritten .swiftinterface) %s -enable-experimental-concurrency -DLIBRARY -module-name LibraryPreserveTypesAsWritten -module-interface-preserve-types-as-written
47
+ // RUN: %target-swift-typecheck-module-from-interface(%t/LibraryPreserveTypesAsWritten .swiftinterface) -enable-experimental-concurrency
48
+ // RUN: %FileCheck %s < %t/LibraryPreserveTypesAsWritten .swiftinterface
You can’t perform that action at this time.
0 commit comments