File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -3490,6 +3490,10 @@ void PrintAST::visitAccessorDecl(AccessorDecl *decl) {
34903490 });
34913491 }
34923492
3493+ // handle effects specifiers before the body
3494+ if (decl->hasAsync ()) Printer << " async" ;
3495+ if (decl->hasThrows ()) Printer << " throws" ;
3496+
34933497 printBodyIfNecessary (decl);
34943498}
34953499
Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-frontend -enable-experimental-concurrency -typecheck -swift-version 5 -enable-library-evolution -emit-module-interface-path %t.swiftinterface %s -module-name EffProps
2+ // RUN: %FileCheck %s < %t.swiftinterface
3+
4+ public struct MyStruct { }
5+
6+ // CHECK-LABEL: public var status
7+ // CHECK: get async throws
8+
9+ public extension MyStruct {
10+ struct InnerStruct {
11+ public var status : Bool { get async throws { false } }
12+ }
13+ }
14+
15+ // CHECK-LABEL: public var hello
16+ // CHECK: get async
17+
18+ // CHECK-LABEL: public subscript
19+ // CHECK: get async throws
20+
21+ public class C {
22+ public var hello : Int { get async { 0 } }
23+
24+ public subscript( _ x: Int ) -> Void {
25+ get async throws { }
26+ }
27+ }
28+
29+ // CHECK-LABEL: public var world
30+ // CHECK: get throws
31+
32+ public enum E {
33+ public var world : Int { get throws { 0 } }
34+ }
You can’t perform that action at this time.
0 commit comments