Summary
When a function signature changes (e.g. adding a parameter of the same type as an existing one), slot reference indices for that type shift throughout the body. The type checker catches all breakage immediately, but fixing it is manual.
A vera refactor command (or extension to vera fmt) could mechanically rewrite all affected references given an old and new signature. The per-type indexing system makes this purely structural — the tool computes the index delta per type and applies it.
Motivation
Criticism of slot references: "Positional indices change with change of structure. Add one argument to a function, and you have to rewrite all of that."
Current mitigations:
- Per-type indexing limits blast radius (adding
@String doesn't shift @Int indices)
- Type checker catches 100% of breakage (no silent misreferences)
- But the rewriting itself is still manual
Possible approaches
vera refactor rename-param — given a function name and a signature diff, rewrite all slot references in the body
- Extend
vera fmt — detect signature/body index mismatches and fix them automatically
- LSP integration — signature change triggers automatic reference update
Scope
Ecosystem tooling (C10). The compiler already provides all the information needed (type-indexed binding scopes, deterministic resolution); this is about building the convenience tool on top.
Summary
When a function signature changes (e.g. adding a parameter of the same type as an existing one), slot reference indices for that type shift throughout the body. The type checker catches all breakage immediately, but fixing it is manual.
A
vera refactorcommand (or extension tovera fmt) could mechanically rewrite all affected references given an old and new signature. The per-type indexing system makes this purely structural — the tool computes the index delta per type and applies it.Motivation
Criticism of slot references: "Positional indices change with change of structure. Add one argument to a function, and you have to rewrite all of that."
Current mitigations:
@Stringdoesn't shift@Intindices)Possible approaches
vera refactor rename-param— given a function name and a signature diff, rewrite all slot references in the bodyvera fmt— detect signature/body index mismatches and fix them automaticallyScope
Ecosystem tooling (C10). The compiler already provides all the information needed (type-indexed binding scopes, deterministic resolution); this is about building the convenience tool on top.