[SR-15309] Task isCancelled instance property not reporting value correctly #57631
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
concurrency
Feature: umbrella label for concurrency language features
Environment
Xcode 13 RC, Swift 5.5
iPhone 12 Pro Simulator
Additional Detail from JIRA
md5: 92ab0d5576a0c182a9c51b9e2efb9230
Issue Description:
The `isCancelled` instance property on a Task is not reporting the correct value. This test fails 100/100 times:
```
func testCancelBug() async {
let t = Task {
await Task.yield()
XCTAssertTrue(Task.isCancelled)
}
t.cancel()
XCTAssertTrue(t.isCancelled) // Fails here: XCTAssertTrue failed
}
```
The text was updated successfully, but these errors were encountered: