Additional Detail from JIRA
|
|
Votes |
0 |
Component/s |
Compiler |
Labels |
Improvement |
Assignee |
None |
Priority |
Medium |
md5: e84eb2c1f41a9810e0beb09fb30b42a4
Issue Description:
The following code pattern is incorrect.
var local: CheckedContinuation<Void, Never>?
withCheckedContinuation { cont in
local = cont
}
I was confused why this created a hang, then after talking to John, I realized I need to store the continuation on an actor's property, that way, some other task can come along and (thanks to actor reentrancy) access the property, optionally do some work and then resume the continuation.
If possible, it would be nice to have a warning for this kind of code.