Skip to content

Commit 93f6da0

Browse files
fix syntax for example
I was not able to compile the motivating example with Swift 6. I had to make a few small modifications (including adding an init, which I have omitted for clarify). This now is compilable, and I *think* retains all the original meaning.
1 parent cd8dacd commit 93f6da0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

proposals/0424-custom-isolation-checking-for-serialexecutor.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The following example demonstrates such a situation:
2323
import Dispatch
2424

2525
actor Caplin {
26-
let queue: DispatchSerialQueue(label: "CoolQueue")
26+
let queue = DispatchSerialQueue(label: "CoolQueue")
2727

2828
var num: Int // actor isolated state
2929

@@ -36,9 +36,9 @@ actor Caplin {
3636
queue.async {
3737
// guaranteed to execute on `queue`
3838
// which is the same as self's serial executor
39-
queue.assertIsolated() // CRASH: Incorrect actor executor assumption
40-
self.assumeIsolated { // CRASH: Incorrect actor executor assumption
41-
num += 1
39+
self.queue.assertIsolated() // CRASH: Incorrect actor executor assumption
40+
self.assumeIsolated { caplin in // CRASH: Incorrect actor executor assumption
41+
caplin.num += 1
4242
}
4343
}
4444
}

0 commit comments

Comments
 (0)