Channel builtins return Result not panic
Platform spec ADR
Channel builtins return Result not panic
Spec standingStandard
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Context
Section titled “Context”Panicking on backpressure or closed channels makes cooperative code fragile and inconsistent with corelib Result types.
Decision
Section titled “Decision”| Operation | Runtime behavior |
|---|---|
| Send after Close | Closed in Result |
| Receive on closed empty | Closed |
| TrySend / TryReceive | Option for full/empty |
| Cancel | Parked ops wake with Cancelled after child OnCancelled |
| Join on cancelled child | FiberError::Cancelled |
| Panic | Forbidden for ordinary channel/hub/mutex errors |
Aligns with D-CORE-CONC-0005.
Consequences
Section titled “Consequences”Builtin implementations and corelib wrappers must share error enums. Duplicate Close is idempotent-safe.
Verification anchors
Section titled “Verification anchors”Contracts and edge cases; concurrency runtime tests.