Skip to content

main: keep the default IFormattable.ToString of IValueSetFactory out of ILCompiler's inlining (port of #315, dotnet/runtime#136073) #317

Closed

Description

@CaffeinatedCoder

Port of #315 to main. That issue is closed: PR #316 landed on release/10.x as 3ed738e.

Problem

#291 kept the Native AOT trap (dotnet/runtime#136073) out of the 11 line by giving each value set family its
own IFormattable.ToString. That holds only while every family carries the override: a family added without
one compiles, passes every test on the SDK CI runs, and traps (exit 133, no output) only in a net11.0
Native AOT publish. IValueSetFactory<,> cannot be implemented outside this repository (FromTrusted is
internal abstract), so this is a guard for future families here, not a consumer-facing gap.

Change

[MethodImpl(MethodImplOptions.NoInlining)] on the default IFormattable.ToString of
IValueSetFactory<TSet, T>, the workaround hez2010 gave on dotnet/runtime#136073, plus a conventions test
asserting the flag by reflection. Measured on 10.x with SDK 11.0.100-rc.2.26504.105: the 10.0.0 state of the
sets exits 133 without it and runs to the end with it (details in #315). No public surface or answer changes.

Done when

Activity

  1. added this to the 11.0.0 milestone on Oct 19, 2026
  2. added
    choreBuild, CI, packaging, refactoring with no behaviour change
    area/value-setsValue set families and wrapper arities
    area/aotNative AOT and trimming
    package/coreAffects CodoMetis.ValueRanges
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/aotNative AOT and trimmingarea/value-setsValue set families and wrapper aritieschoreBuild, CI, packaging, refactoring with no behaviour changepackage/coreAffects CodoMetis.ValueRanges

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions