spawn returns Fiber handle not T
Platform spec ADR
spawn returns Fiber handle not T
Spec standingStandard
- No directly attached article pages for this node.
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”Authors need a single cooperative concurrency entry keyword with an explicit handle for cancellation and join.
Decision
Section titled “Decision”| Rule | Detail |
|---|---|
| Keyword | spawn introduces a child fiber |
| Type | Expression must type-check to a Fiber<T> handle for the entry return type T (not T directly) |
| Result | spawn must not return the entry value; use Join for Result<T, FiberError> |
| Contract | The handle shape is the corelib_concurrency Fiber<T> type required by lowering |
Consequences
Section titled “Consequences”Parser, semantic analysis, and codegen share one spawn contract with the concurrency package.
Verification anchors
Section titled “Verification anchors”compiler/crates/beskid_analysis/; compiler/crates/beskid_codegen/ spawn lowering; Concurrency package.