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 @@ -3496,6 +3496,10 @@ void PrintAST::visitAccessorDecl(AccessorDecl *decl) {
3496
3496
});
3497
3497
}
3498
3498
3499
+ // handle effects specifiers before the body
3500
+ if (decl->hasAsync ()) Printer << " async" ;
3501
+ if (decl->hasThrows ()) Printer << " throws" ;
3502
+
3499
3503
printBodyIfNecessary (decl);
3500
3504
}
3501
3505
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