Represent async effects and await sites in TypedProgram
- Dominant language
- Rust
- Stars
- 53
- Forks
- 16
- Avg merge
- 4h 22m
- Merged PRs (30d)
- 46
Description
Parent: #439
Depends on: #407, #440, and #441.
## Summary
Represent asynchronous effects and await sites in backend-neutral typed HIR.
## Scope
- Assign stable HIR identities to every await expression.
- Record the completed result type of each async function and the asynchronous type returned by a call.
- Require `await` to appear in an async context unless the language contract explicitly defines another context.
- Require the awaited operand to implement the agreed future/poll contract.
- Preserve generic substitutions, imported function identity, variant payload types, and source spans.
- Reject recursive type/effect cycles with diagnostics rather than backend panics.
- Reject unsupported async FFI and entry-point forms according to the semantics issue.
## Completion criteria
- [ ] `TypedProgram` answers whether a function is async and resolves each await operand/result type.
- [ ] Valid generic and imported async calls retain concrete types after monomorphization.
- [ ] Invalid await contexts and operand types report the relevant source span.
- [ ] No downstream consumer calls AST-local type inference for async nodes.
- [ ] Positive and negative frontend fixtures cover nesting, control flow, variants, pointers, and early returns.
Contributor guide
Research direction
Start by reading the parent issue #439 and dependencies #407, #440, and #441, then trace the existing TypedProgram representation. Define the work against the listed completion criteria: async functions and await results must resolve correctly, invalid contexts must report source spans, and frontend fixtures must cover the named cases without AST-local async inference downstream.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100