Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes are documented here. The format follows [Keep a Changelog](h

## [Unreleased]

### Tests

- **The test suite compiles on Swift 6.4 (Xcode 27.0).** 6.4's region-isolation checker rejects two `withTaskCancellationHandler` call sites in `CancellationTests` and `InheritCancellationContextTests` ("passing closure as a `sending` parameter risks causing data races"): the `onCancel` closure implicitly captured a `LockIsolated` counter that the enclosing `model.task { }` closure also uses, and the checker merges the two closures' regions. An explicit `[$count]` / `[$cancelCount]` capture list gives `onCancel` its own copy of the (Sendable) reference and the checker is satisfied. No behavioural change; the library itself already compiled on 6.4 once 1.0.19 landed.

---

## [1.0.19] — Swift 6.4 `@Model` closure-property compiler crash fix
Expand Down
2 changes: 1 addition & 1 deletion Tests/SwiftModelTests/CancellationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ struct CancellationTests {
// Using a long sleep so the task cannot complete naturally before being cancelled.
await inHandler.send(())
try await Task.sleep(nanoseconds: nanosPerSecond * 60)
} onCancel: {
} onCancel: { [$count] in
$count.wrappedValue += 1
}
$count.wrappedValue += 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct InheritCancellationContextTests {
// This guarantees cancelAll below fires onCancel synchronously.
await inHandler.send(())
try await Task.sleep(nanoseconds: nanosPerSecond * 60)
} onCancel: {
} onCancel: { [$cancelCount] in
$cancelCount.wrappedValue += 1
}
} catch: { _ in }
Expand Down