Open tmat opened 4 weeks ago
The runtime doesn't support adding a static field to a struct or class with explicit layout.
@tmat auto and sequential layout works?
I have not tested all possible layouts. Just structs. Auto class layout is the default, right? That works fine.
Description
The runtime doesn't support adding a static field to a struct or class with explicit layout.
This is an odd limitation as static field does not affect layout of the object.
The operation currently fails on all runtimes: .NET Framework, .NET 9, Mono.
Reproduction Steps
Roslyn currently blocks such an edit but a CLR test can be easily written to demonstrate the issue. I can also supply private Roslyn build that removes the rude edit.
Expected behavior
Adding static field into a struct should work.
Actual behavior
Application of EnC delta fails.
Regression?
No.
Known Workarounds
No response
Configuration
No response
Other information
No response