ImmutabilityPlugin detects reassignment to let-declared variables and reports compile-time errors for violations. This plugin enforces Rust-like immutability semantics: - Direct reassignment: x = value (error) - Compound assignment: x += 1 (error) - Increment/decrement: x++, x-- (error) - Pointer d
| 32 | // - Index assignment: x[0] = value (ok) |
| 33 | // - Map assignment: x["key"] = value (ok) |
| 34 | type ImmutabilityPlugin struct { |
| 35 | ctx *plugin.Context |
| 36 | immutableVars map[string]token.Pos // varName -> declaration position |
| 37 | typeInfo *types.Info // For pointer type resolution |
| 38 | } |
| 39 | |
| 40 | // NewImmutabilityPlugin creates a new immutability checking plugin |
| 41 | func NewImmutabilityPlugin() *ImmutabilityPlugin { |
nothing calls this directly
no outgoing calls
no test coverage detected