Repository navigation
Clarify struct-to-enum breaking changes and R2R cast folding - #137100
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
|
@copilot Please examine the failures on this PR. |
I examined the failed checks. Eight jobs across |
Build break is fixed in main. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the ReadyToRun cast-folding compatibility update.
No open issues 🎉
What changed in this PR
This PR aligns ReadyToRun cast folding with the clarified compatibility rule that structs and enums cannot be converted into one another across versions, addressing #137055.
Changes:
- Explicitly disallows changing a
structto anenumor vice versa. - Removes the
System.Enumexception from negative-cast version-resilience checks. - Adds a struct-to-
System.Enumregression case and checks that folding avoids importingSystem.Enum.
| File | Description |
|---|---|
src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs |
Simplifies value-type negative-cast resilience logic and updates its comment. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs |
Asserts that System.Enum is absent from imported types. |
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/CastFolding/CastFolding.cs |
Adds the struct-to-enum cast-folding test case. |
docs/coding-guidelines/breaking-change-rules.md |
Explicitly prohibits conversions between structs and enums. |
Review effort: Balanced
Added changing a struct to an enum or vice versa as a breaking change.
Co-authored-by: AaronRobinsonMSFT <30635565+AaronRobinsonMSFT@users.noreply.github.com>
|
/ba-g build analysis stuck |
The breaking-change rules did not explicitly prohibit converting between a
structand anenum, though R2R relies on that distinction remaining stable across version bubbles.structandenumas disallowed.System.Enum.