File tree Expand file tree Collapse file tree 1 file changed +34
-9
lines changed
Expand file tree Collapse file tree 1 file changed +34
-9
lines changed Original file line number Diff line number Diff line change @@ -3445,6 +3445,24 @@ final class DeclarationTests: ParserTestCase {
34453445 }
34463446
34473447 func testCoroutineAccessors( ) {
3448+ assertParse (
3449+ """
3450+ var i: Int {
3451+ yielding borrow {
3452+ yield _i
3453+ }
3454+ yielding mutate {
3455+ yield &_i
3456+ }
3457+ }
3458+ """
3459+ )
3460+ }
3461+
3462+ func testCoroutineAccessorsLegacyFormat( ) {
3463+ // `read` and `modify` syntax require experimental feature
3464+ // flag and always will, since that wasn't the final accepted
3465+ // syntax for SE-0474
34483466 assertParse (
34493467 """
34503468 var irm: Int {
@@ -3467,21 +3485,15 @@ final class DeclarationTests: ParserTestCase {
34673485 read {
34683486 yield _i
34693487 }
3470- yielding borrow {
3471- yield _i
3472- }
34733488 _modify {
34743489 yield &_i
34753490 }
34763491 modify {
34773492 yield &_i
34783493 }
3479- yielding mutate {
3480- yield &_i
3481- }
34823494 }
34833495 """ ,
3484- experimentalFeatures: [ . coroutineAccessors, . borrowAndMutateAccessors ]
3496+ experimentalFeatures: . coroutineAccessors
34853497 )
34863498 assertParse (
34873499 """
@@ -3519,6 +3531,20 @@ final class DeclarationTests: ParserTestCase {
35193531 )
35203532 }
35213533
3534+ func testMultipleModifiers( ) {
3535+ assertParse (
3536+ """
3537+ public struct S {
3538+ var v: Int {
3539+ __consuming consuming borrowing mutating nonmutating yielding get {
3540+ 0
3541+ }
3542+ }
3543+ }
3544+ """
3545+ )
3546+ }
3547+
35223548 func testBorrowAndMutateAccessors( ) {
35233549 assertParse (
35243550 """
@@ -3536,8 +3562,7 @@ final class DeclarationTests: ParserTestCase {
35363562 }
35373563 }
35383564 }
3539- """ ,
3540- experimentalFeatures: . borrowAndMutateAccessors
3565+ """
35413566 )
35423567 }
35433568
You can’t perform that action at this time.
0 commit comments