Skip to content

Fix optional parameter metadata emission - #2759

Merged
DavidObando merged 1 commit into
mainfrom
fix/2745-generalized-parameter-defaults
Jul 22, 2026
Merged

Fix optional parameter metadata emission#2759
DavidObando merged 1 commit into
mainfrom
fix/2745-generalized-parameter-defaults

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • centralize source parameter-row emission so methods, explicit/primary constructors, interfaces, delegates, and managed interop surfaces emit CLR Optional/HasDefault flags plus Constant rows
  • normalize constants to the declared parameter type and reject mismatched or unsupported CLR metadata constants without changing G# omitted-argument materialization
  • add metadata, reflection, ILVerify, G# runtime, and real Roslyn C# consumer regressions across numeric, string, enum, bool, char, floating-point, and nil defaults

Validation

  • targeted optional emit tests: 16 passed
  • targeted optional binding tests: 16 passed
  • full Core.Tests: 6,691 passed, 1 skipped
  • full Compiler.Tests: 3,384 passed; 19 environment-only failures because Gsharp.Extensions.dll had not been built; after building it, all affected classes passed (128/128)
  • RC-C13-6 Oahu rerun: rebuilt Oahu.Cli.App and Oahu.Cli.Tui with this compiler, then compiled the full C# test corpus against them; CS7036 fell from 12 reported failures to 0

Deferred

  • Oahu still reports unrelated ABI/nullability families (CS1729, CS1739, CS8858, CS8602/CS8604, CS8613, CS8766); these map to the separately reported RC-C13-5/7 and nullable-fidelity work.

Fixes #2745

@DavidObando
DavidObando merged commit 47819f5 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.

gsc: default parameters omit CLR optional parameter metadata

1 participant