cs2gs + LS: preserve C# tuple element names + completion (ADR-0172 Phases C+D, #3501) - #3623
Merged
DavidObando merged 2 commits intoAug 29, 2026
Merged
Conversation
The translator now emits the ADR-0172 named-tuple surface instead of erasing names: tuple TYPES print name-first ((Line int32, Column int32) — CSharpTypeMapper keeps Roslyn's TupleElements names, default ItemN-at-position counts as unnamed, and the ADR-0115 §B.4 name-drop Info diagnostic is gone), literal LABELS survive ((Count: 3, Name: "three") via NameColon), and a named element ACCESS stays by-name — item.Price * item.Quantity round-trips verbatim where it previously lowered to item.Item2 * item.Item3. Default positional access (.ItemN) still normalizes to the positional field. TupleTypeReference and TupleLiteralExpression gain optional element-name lists; the printer renders both forms. Corpus: 18/20 diagnostic-run green with the branch gsc (CompileGap- Library is the known wontfix; L3-Library's test-parity failure is the documented stale-SDK-nupkg trap — the parity stage rebuilds with the packaged gsc, which predates ADR-0172; CI builds the SDK from the same commit). L1's translated output now reads item.Price * item.Quantity with List[(Name string, Price int32, Quantity int32)]. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nng28yiBdPVdeML7mSZphs
A tuple-typed receiver's dot-completion offers its declared element names first, then the positional ItemN spellings (both resolve), with the element type as the detail. Hover/diagnostics already render named tuples via SymbolDisplay's ADR-0172 tuple case. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nng28yiBdPVdeML7mSZphs
DavidObando
force-pushed
the
feature/named-tuple-cs2gs
branch
from
August 29, 2026 00:06
9b7f1d7 to
3fc6d43
Compare
DavidObando
force-pushed
the
feature/named-tuple-elements
branch
from
August 29, 2026 00:06
77ea62e to
a806e04
Compare
Owner
Author
|
Also carries Phase D (LS): tuple-typed receivers' dot-completion now offers declared element names first, then the positional |
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
Stacked on #3622 (named tuple elements, Phases A+B) — Phase C of ADR-0172: cs2gs stops erasing C# tuple element names, delivering the #3501 readability win across the ~830 named-tuple declaration lines in the self-migration corpus.
(int Line, int Column)→(Line int32, Column int32)(CSharpTypeMapperkeeps Roslyn'sTupleElementsnames; a defaultItemN-at-position counts as unnamed; the ADR-0115 §B.4 name-drop Info diagnostic is retired). Names survive the nullability-promotion rebuild sites too (oblivious promotion, whole-type nullable wraps).(Count: 3, Name: "three")viaNameColon.item.Price * item.Quantityround-trips verbatim where it previously lowered toitem.Item2 * item.Item3; default positional.ItemNaccess still normalizes positionally.TupleTypeReference/TupleLiteralExpressiongain optional element-name lists; the printer renders both forms.Verification
Adr0172NamedTupleTranslationTests(6): name-first types, by-name access, positional access unchanged, literal labels, unnamed tuples unchanged, names inside generics — every snippet re-binds through the real gsc (exercising the G#: named tuple elements — Phases A+B: front end + metadata interop (ADR-0172, #3501) #3622 front end).docs/cs2gs-coverage-matrix.mdregenerated viacs2gs coverage --write.out/bin/Releasegsc found byFindCompiler— rebuilt — and a stale expectation).total += item.Price * item.QuantitywithList[(Name string, Price int32, Quantity int32)].🤖 Generated with Claude Code
https://claude.ai/code/session_01Nng28yiBdPVdeML7mSZphs