File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -108,3 +108,26 @@ extension TestActor {
108
108
await position. setComponents ( x: & value1, y: & value2)
109
109
}
110
110
}
111
+
112
+ // Check implicit async testing
113
+ actor class DifferentActor {
114
+ func modify( _ state: inout Int ) { }
115
+ }
116
+
117
+ extension TestActor {
118
+ func modify( _ state: inout Int ) { }
119
+
120
+ // Actor state passed inout to implicitly async function on an actor of the
121
+ // same type
122
+ func modifiedByOtherTestActor( _ other: TestActor ) async {
123
+ //expected-error@+1{{actor-isolated property 'value2' cannot be passed 'inout' to asynchronous function}}
124
+ await other. modify ( & value2)
125
+ }
126
+
127
+ // Actor state passed inout to an implicitly async function on an actor of a
128
+ // different type
129
+ func modifiedByOther( _ other: DifferentActor ) async {
130
+ //expected-error@+1{{actor-isolated property 'value2' cannot be passed 'inout' to asynchronous function}}
131
+ await other. modify ( & value2)
132
+ }
133
+ }
You can’t perform that action at this time.
0 commit comments