implements PR016
This commit is contained in:
@@ -1,44 +0,0 @@
|
||||
# PR-016 - PBS Assignment Target and Field Access Semantics
|
||||
|
||||
## Briefing
|
||||
|
||||
Assignment validation currently does not enforce target existence, assignability, mutability, or write-access constraints. This PR closes those gaps.
|
||||
|
||||
## Motivation
|
||||
|
||||
Unchecked assignment targets allow invalid programs through static semantics.
|
||||
|
||||
## Target
|
||||
|
||||
- Assignment statement semantic analysis.
|
||||
- Struct field read/write access validation (`private`, `pub`, `pub mut`).
|
||||
|
||||
## Scope
|
||||
|
||||
- Resolve LValue path against known symbols.
|
||||
- Validate assignment compatibility and write permissions.
|
||||
- Emit deterministic diagnostics for invalid target/write access.
|
||||
|
||||
## Method
|
||||
|
||||
- Add LValue resolver in flow semantic analyzer.
|
||||
- Use struct metadata (`isPublic`, `isMutable`) for access checks.
|
||||
- Distinguish read-access and write-access diagnostics.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- Missing assignment target is rejected deterministically.
|
||||
- Writes to private fields from invalid contexts are rejected.
|
||||
- Writes to non-`pub mut` external fields are rejected.
|
||||
- Type mismatch in assignment is reported deterministically.
|
||||
|
||||
## Tests
|
||||
|
||||
- Add assignment tests for local, field, and nested member targets.
|
||||
- Add negative access tests (`pub` read-only vs `pub mut`).
|
||||
- Add type-mismatch assignment tests.
|
||||
|
||||
## Non-Goals
|
||||
|
||||
- New mutation syntax.
|
||||
- Runtime memory model changes.
|
||||
Reference in New Issue
Block a user