mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-23 22:06:04 +00:00
A default says nothing about the argument a caller passes, so
`function(x, helper = 2) helper(x)` reaches the parameter when the caller
passes a function and the outer function when it does not, and
`function(x, helper) helper(x)` may reach either too. The rename provider and
the scope captures read the default as proof; every named formal is now treated
alike ("maybe").
Claim A (constant default): `role()` no longer marks a constant-default formal
'unrelated', so the call under it is not renamed with the function, and
checkSafety refuses it with ambiguous_reference.
Claim B (no default): the same call under a default-less formal is refused the
same way (it used to be left behind silently).
New-name side: a call of the NEW name under a same-named formal is a read of
the new name (name_collision) for every formal, not only those with a default;
a plain read of the formal is still not a read.
Call-side twin: rFunctionLexicalNames no longer skips constant-default formals,
so a call through any named formal gets no CALLS edge to an outer function of
that name (the rename planner and the resolver now agree).
The parameter lattice (RParameterKind, kindOfParameter, parameterNamed,
rParameterKind, innermostParameterKind) collapses into the boolean
isRParameterName and a private hasEnclosingParameter. isRConstantValue,
rBoundName and rOwnAssignedNames move to R/assignment.ts (kept, not deleted:
the assignment work needs them); captures.ts no longer imports from rename.ts.
Verdict changes (rename fixtures, helper -> assist unless noted):
- parameter-constant-default-call: success (2 edits) -> error ambiguous_reference
- parameter-constant-default-call-and-read: incomplete_semantics -> ambiguous_reference
- function-unrelated-parameter (compute -> calculate): success -> error ambiguous_reference
- new parameter-no-default-call: error ambiguous_reference
- new collision-new-name-parameter-call: error name_collision
- new parameter-read-only (control): success, 1 edit
- unchanged: parameter-assigned-call, parameter-function-default-call,
collision-unrelated-uses, value-reference-*
CALLS edges: r-formal-shadows `constant_default` no longer reaches `transform`;
`plain` still does.
Tests: r-rename-parameter-shadow (rewritten for isRParameterName and the
collapsed verdicts), r-lexical-names, r-rename-collisions (a call under a
default-less formal named like the new name now collides), r-formal-shadows,
rename-provider-r (58 fixtures). docs/languages/r-provider.md lines on formals,
the rename guard and the new-name collision updated.
|
||
|---|---|---|
| .. | ||
| languages | ||
| plans | ||
| cli-reference.md | ||
| deployment.md | ||
| editor-setup.md | ||
| mcp-reference.md | ||
| wiki-generation.md | ||