File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,12 @@ extension ASTGenVisitor {
393
393
return . modify
394
394
case . `init`:
395
395
return . `init`
396
+ case . read:
397
+ precondition ( ctx. langOptsHasFeature ( . CoroutineAccessors) , " (compiler bug) 'read' accessor should only be parsed with 'CoroutineAccessors' feature " )
398
+ return . read2
399
+ case . modify:
400
+ precondition ( ctx. langOptsHasFeature ( . CoroutineAccessors) , " (compiler bug) 'modify' accessor should only be parsed with 'CoroutineAccessors' feature " )
401
+ return . modify2
396
402
default :
397
403
self . diagnose ( . unknownAccessorSpecifier( specifier) )
398
404
return nil
Original file line number Diff line number Diff line change 1
1
2
2
// RUN: %empty-directory(%t)
3
3
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency -enable-experimental-feature ParserASTGen \
4
+ // RUN: -enable-experimental-feature CoroutineAccessors \
4
5
// RUN: | %sanitize-address > %t/astgen.ast
5
6
// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency \
7
+ // RUN: -enable-experimental-feature CoroutineAccessors \
6
8
// RUN: | %sanitize-address > %t/cpp-parser.ast
7
9
8
10
// RUN: %diff -u %t/astgen.ast %t/cpp-parser.ast
9
11
10
- // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature ParserASTGen)
12
+ // RUN: %target-run-simple-swift(-Xfrontend -disable-availability-checking -Xfrontend -enable-experimental-concurrency -enable-experimental-feature CoroutineAccessors -enable-experimental-feature ParserASTGen)
11
13
12
14
// REQUIRES: executable_test
13
15
// REQUIRES: swift_swift_parser
14
16
// REQUIRES: swift_feature_ParserASTGen
17
+ // REQUIRES: swift_feature_CoroutineAccessors
15
18
16
19
// rdar://116686158
17
20
// UNSUPPORTED: asan
@@ -108,6 +111,10 @@ func testVars() {
108
111
var s : Int {
109
112
get async throws { return 0 }
110
113
}
114
+ var t : Int {
115
+ read { yield q }
116
+ modify { yield & q }
117
+ }
111
118
}
112
119
113
120
func rethrowingFn( fn: ( ) throws -> Void ) rethrows { }
You can’t perform that action at this time.
0 commit comments