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,
218218 Printer.printSimpleAttr (" @autoclosure" ) << " " ;
219219 if (hasAttr (TAK_escaping))
220220 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+
221230 if (hasAttr (TAK_Sendable))
222231 Printer.printSimpleAttr (" @Sendable" ) << " " ;
223232 if (hasAttr (TAK_noDerivative))
Original file line number Diff line number Diff line change @@ -20,6 +20,11 @@ public func takesSendable(
2020 _ block: @Sendable @escaping ( ) async throws -> Void
2121) { }
2222
23+ @available ( SwiftStdlib 5 . 5 , * )
24+ public func takesMainActor(
25+ _ block: @MainActor @escaping ( ) -> Void
26+ ) { }
27+
2328// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency -I %t
2429
2530#else
@@ -31,12 +36,13 @@ func callFn() async {
3136}
3237#endif
3338
34- // RUN: %FileCheck %s <%t/Library.swiftinterface
39+ // RUN: %FileCheck %s < %t/Library.swiftinterface
3540// CHECK: // swift-module-flags:{{.*}} -enable-experimental-concurrency
3641// CHECK: public func fn() async
3742// CHECK: public func reasyncFn(_: () async -> ()) reasync
3843// CHECK: public func takesSendable(_ block: @escaping @Sendable () async throws ->
44+ // CHECK: public func takesMainActor(_ block: @escaping @{{_Concurrency.MainActor|MainActor}} () ->
3945
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