docs(justdummies): document ConstraintCall.Of's argument convention - #394
Merged
Conversation
Of's second parameter takes rendered text, not parameter names, and the distinction was only legible from the sites that use it: V(minimum) and Join(values) render a value, while "comparer" and "<generator>" stand in for an argument the library must not render. The two shapes read alike at a call site, so "comparer" invites nameof(comparer) — which compiles, produces the same string today, and quietly ties a user-facing message to a parameter identifier. ADR-0065 ties a constraint's name to its method through nameof, for reasons that stop at the name: a method name is a public symbol a rename must carry along. A stand-in is prose. Binding it to a symbol would let a rename local to one overload reword a diagnostic, and would leave the same constraint reading differently across the generators declaring it. Documentation only: no code, no message and no test changes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SuSBsGG7wMPMnSeTHKZAom
Reefact
force-pushed
the
claude/anyarray-distinct-nameof-8m5won
branch
from
July 31, 2026 00:14
3f93ad7 to
02ff496
Compare
Reefact
enabled auto-merge
July 31, 2026 00:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ConstraintCall.Of's second parameter takes rendered text, not parameter names, and that was only legible from the sites using it. Where the rendered text happens to spell a parameter —Distinct(comparer)— the call reads like a missingnameof, so this documents why it is a literal, on the factory that defines the rule.Type of change
Changes
<remarks>block toConstraintCall.Ofstating thatargumentscarries rendered text, and naming the two shapes that reach it: a value the declaring generator rendered itself (V(minimum),Join(values)→Between(0, 100)), and a word standing in for an argument that has no useful rendering, written where it reads better than the ellipsisOfElidedwould give (Distinct(comparer),ContainingAny(<generator>)).nameof(...)does not belong there even when the parameter it would name happens to spell it — with the reason the rule differs fromname's: a method name is a public symbol the message must follow through a rename (ADR-0065), whereas a stand-in is prose whose resemblance to a parameter is a coincidence of good naming. Tying it to the symbol would let a rename local to one overload silently reword a user-facing message, and would leave the same constraint reading differently across the generators declaring it.No code, no diagnostic message and no test changes: the only file touched is
JustDummies/ConstraintCall.cs, and only its XML documentation.Testing
Run on the rebased branch, whose base is
574a982:dotnet build FirstClassErrors.sln— succeeded, 0 warnings, 0 errorsdotnet test FirstClassErrors.sln— 2193 passed, 0 failed, 0 skipped across the 13 suitesFirstClassErrors.Analyzers.UnitTests) — 132 passed, run as part of the solution test aboveDocumentation
ConstraintCall.Offactorydoc/updateddoc/handwritten/for-users/README.fr.md) updated if user-facing behavior changedNo user-facing behavior changed, so the French user documentation is untouched.
Architecture decisions
Proposed: ADR-____This writes down the boundary of a decision already recorded rather than taking a new one: ADR-0065 ties a constraint's name to its method through
nameof, and its rationale is about a public symbol surviving a rename. Nothing in it extends to the arguments, and this documents where the rule stops.Related issues
None.