Skip to content

Preserve explicit struct constructor ABI - #2768

Merged
DavidObando merged 1 commit into
mainfrom
fix/2766-value-type-constructor-abi
Jul 22, 2026
Merged

Preserve explicit struct constructor ABI#2768
DavidObando merged 1 commit into
mainfrom
fix/2766-value-type-constructor-abi

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • admit explicit init overloads on plain G# structs and emit real CLR value-type constructors
  • keep translated C# plain-struct constructors, source parameter names, fields, visibility, and properties instead of primary-constructor/literal reshaping
  • preserve same-language calls, overloads, delegation, expression/block bodies, and generic struct calls
  • leave classes on Preserve explicit class constructor ABI in cs2gs #2760's path and records/data structs on Fix C# record ABI for data types #2767's separate path

Validation

  • targeted value-constructor/ABI/negative-control tests: 35 passed
  • Core.Tests: 6,694 passed, 1 skipped
  • Compiler.Tests: 3,431 passed
  • Cs2Gs.Tests: 1,731 passed (1,730 full batch + isolated pre-existing shared-asset collision test)
  • Oahu/ABI targeted suites: 56 passed

Oahu proof

Oahu 200e3b4c26c781368f74bbef098caea89bac8754 contains only two plain structs (LinuxUcred, MacXucred), both field-only with no explicit constructor. Constructor-bearing Oahu value types are records and remain covered by #2767. The Oahu translation/ABI suites and the real C# named-argument/getter/field consumer all pass; no #2766-scoped Oahu ABI failure remains.

Fixes #2766

@DavidObando
DavidObando merged commit 90e460b into main Jul 22, 2026
10 checks passed
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.

cs2gs/gsc: explicit struct constructor lowering breaks C# consumer ABI

1 participant