Skip to content

Preserve constrained interface setters through spills - #2762

Merged
DavidObando merged 1 commit into
mainfrom
fix/2741-constrained-initializer
Jul 22, 2026
Merged

Preserve constrained interface setters through spills#2762
DavidObando merged 1 commit into
mainfrom
fix/2741-constrained-initializer

Conversation

@DavidObando

Copy link
Copy Markdown
Owner

Summary

  • preserve constrained type-parameter/interface metadata when CLR property assignments are rebuilt by synchronous or async spill lowering
  • keep ordinary interface receivers on the existing non-constrained path
  • cover looped object initializers, ordinary receivers, and awaited initializer values with runtime + ILVerify tests

Validation

  • focused regressions: 3 passed (runtime and ILVerify)
  • Core.Tests: 6,691 passed, 1 skipped
  • Compiler.Tests: 3,404 passed
  • all suites run sequentially with MSBUILDDISABLENODEREUSE=1

Oahu proof

  • cycle-13 Oahu.Core.dll baseline: 64 ILVerify errors, 2 in BookLibrary::AddPersons
  • rebuilt with this compiler: 62 ILVerify errors, 0 in BookLibrary::AddPersons
  • fixed IL now emits ldloca + constrained. !!TPerson before both interface setters; fingerprint sha256:4d566c0d76371f805c1e11e8847eaa0f6c90365b740e98ff648d9189e76f30b2 is absent

Deferred work

Fixes #2741

@DavidObando
DavidObando merged commit 8eee9f7 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 emitter: constrained generic interface setter in object initializer omits receiver boxing

1 participant