Warn when a `state` variable is possibly read after possibly being written
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- Rust
- Stars
- 126
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
To avoid the confusion between the blocking non-behavior of state, and the blocking behavior on non-state, we should just forbid reading from a state wire lexically after writing to it.
So
state int x
x = 5
int b = x // Warning on this line, because x hasn't been updated yet
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No implementation file or test is named in the issue. Start by locating the compiler's handling of state wires and lexical reads and writes, then trace how warnings are emitted. Add coverage for the shown state int x example and verify that reading x after x = 5 produces a warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100