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 {
393393 return . modify
394394 case . `init`:
395395 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
396402 default :
397403 self . diagnose ( . unknownAccessorSpecifier( specifier) )
398404 return nil
Original file line number Diff line number Diff line change 11
22// RUN: %empty-directory(%t)
33// 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 \
45// RUN: | %sanitize-address > %t/astgen.ast
56// RUN: %target-swift-frontend-dump-parse -disable-availability-checking -enable-experimental-move-only -enable-experimental-concurrency \
7+ // RUN: -enable-experimental-feature CoroutineAccessors \
68// RUN: | %sanitize-address > %t/cpp-parser.ast
79
810// RUN: %diff -u %t/astgen.ast %t/cpp-parser.ast
911
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)
1113
1214// REQUIRES: executable_test
1315// REQUIRES: swift_swift_parser
1416// REQUIRES: swift_feature_ParserASTGen
17+ // REQUIRES: swift_feature_CoroutineAccessors
1518
1619// rdar://116686158
1720// UNSUPPORTED: asan
@@ -108,6 +111,10 @@ func testVars() {
108111 var s : Int {
109112 get async throws { return 0 }
110113 }
114+ var t : Int {
115+ read { yield q }
116+ modify { yield & q }
117+ }
111118}
112119
113120func rethrowingFn( fn: ( ) throws -> Void ) rethrows { }
You can’t perform that action at this time.
0 commit comments