Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#struct memory layoutSingle-choice MCQ

What happens at the IL/runtime level when a non-readonly mutating method is called on a `readonly` struct field, e.g. `this.field.Increment()` where `field` is a readonly struct?

readonly struct Counter { int n; public void Inc() => n++; } class C { readonly Counter c; void M() => c.Inc(); }