Enforce-or-retract the $-in-authored-binder-names reservation #44
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from the #43 A2b fix (
55d76ae) and its raw-buf close audit (b151990).fresh_binder(ailang-core::desugar) mints shadow-rename binders as<base>$<n>. Collision-freedom rests on a probe againstused+ in-scope effective names. That probe does NOT see an authored binder literally named<base>$<n>that is out of scope at mint time but later binds under the same(def, name)uniqueness key — the exact collapse class #43 closes. The$-for-synthetic convention is NOT lexer-enforced (ailang-surface/src/lex.rs reserves only.).Latent today (no fixture uses a
$binder), but it is precisely the robustness-against-hallucinations concern: a hallucinating LLM author could emit a$binder.depends on: nothing
context: two candidate closures — (a) enforce the reservation (reject
$in authored binder names, in pre_desugar_validation or the lexer); (b) make the probe complete by seedingusedwith every authored binder name in the current def before renaming. (a) also retroactively justifies the existingfresh/fresh_liftedmachinery. Decide which; it is a real design fork, not a mechanical edit.