Preserve explicit class constructor ABI in cs2gs - #2760
Merged
Conversation
DavidObando
force-pushed
the
fix/2746-cs2gs-abi
branch
from
July 22, 2026 17:36
93786ad to
785cf8a
Compare
This was referenced Jul 22, 2026
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
AnalyzeConstructorLiftrootOutputContext/CapabilityPolicyand a field-backed class through translation, gsc compilation, and a real C# named-argument/property/reflection consumerScope and issue mapping
data class/data structmetadata path; tracked by gsc: data class and data struct metadata is not C# record compatible #2744 (open, no implementation PR yet)initand cs2gs uses primary-constructor/call-site literal lowering; reproduced with a real C# consumer and filed as cs2gs/gsc: explicit struct constructor lowering breaks C# consumer ABI #2766. Earlier cs2gs: struct with multiple ctors that can't lift to primary-ctor form emits invalid init(...) on struct #1990/cs2gs: struct with multiple instance constructors can be silently omitted #2435 only fixed invalid/dropped translation and same-language call sitesNo ABI case discovered in this audit is left untracked.
Validation
MSBUILDDISABLENODEREUSE=1 dotnet test tools/cs2gs/Cs2Gs.Tests/Cs2Gs.Tests.csproj -c Release --no-build --no-restore --nologo: 1,728 passed on latest mainFixes #2746