Skip to content

chore(LC0096): roadmap verdicts, pinning fixtures and the overload migration route - #695

Merged
Arthurvdv merged 4 commits into
mainfrom
chore/lc0096-roadmap-verdicts
Nov 27, 2026
Merged

Arthurvdv merged 4 commits into
mainfrom
chore/lc0096-roadmap-verdicts

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Summary

Feasibility verdicts for the four deferred LC0096 ideas. No analyzer behaviour change: the diff is test fixtures plus the rule doc.

Closes #519

Item Verdict Reason
CodeFix (remove parameter) No Needs the callee signature change, every other caller (invisible for public procedures with dependents, AS0024 breaking change), var vs by-value semantics (by-value is a copy), and a callee body rewrite.
CodeFix (add overload + [Obsolete]) No Mechanically possible (the host applies multi-document code actions) but only yields an intermediate state; the end state (one procedure without the parameter) stays a manual body refactor. Documented as the manual route instead.
RecordRef No A RecordRef cannot be the receiver of a user procedure; Proc(RecRef) after RecRef.GetTable(Rec) needs dataflow tracing and a RecordRef is its own buffer, not Rec.
xRec detection No Rec.AssistEdit(xRec) / Rec.SetUpNewLine(xRec) is the deliberate BC idiom (262 call sites in Microsoft's code); "xRec semantics not needed" is callee intent, not derivable. xRec.Proc(xRec) is already reported (pinned by a fixture).
Cross-module mode No The developer cannot change the dependency's signature; the only call-site change is de-aliasing via a second variable, a different concern (var-parameter aliasing). The BC.LinterCop PR 1132 review hit exactly these Base App false positives (~1,500 X.Proc(X) sites).

Changes

  • Fixtures: HasDiagnostic/XRecSelfArgument (xRec.DoSomething(xRec) is reported); NoDiagnostic/XRecArgumentInTable, XRecArgumentOnPage, RecordRefArgument; new NoDiagnosticWithDependencyProject test with CrossModuleCall (callee in a DependencyProjects workspace project, NoException before the marker check). Each NoDiagnostic marker was confirmed to be a real guard by running it temporarily through HasDiagnosticAtAllMarkers (each failed with "There is no issue reported for LC0096 at [span]").
  • Rule doc: the two CodeFix decisions, the [Bug]: LC0096 triggers when function is also used without Rec #323 resolution, non-report bullets for xRec, RecordRef and cross-module calls, and a test note.

Note on the migration route

The inverted delegation (implementation in the parameterless procedure; the old overload calls MyTable.DoSomething() on its parameter) does not compile on a local procedure: AL0161 "'DoSomething()' is inaccessible due to its protection level" (verified in the test harness). It compiles and stays LC0096-silent with internal. The docs therefore use internal for the #323 shape and keep the copy-to-local overload only for a procedure that must stay local with a by-value parameter.

Docs: ALCops/alcops.dev#246

🤖 Generated with Claude Code

@Arthurvdv
Arthurvdv merged commit a515be1 into main Nov 27, 2026
55 checks passed
@Arthurvdv
Arthurvdv deleted the chore/lc0096-roadmap-verdicts branch November 27, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LC0096: roadmap - CodeFix, RecordRef, xRec detection, cross-module mode

1 participant