Last Updated: May 17, 2026
C# 12 added ref readonly as a parameter modifier. It tells the compiler to pass a value by reference (no copying) while forbidding the method from modifying what the reference points to. The feature exists for one main reason: large readonly structs that you want to pass cheaply, with a clear signal at the call site that the caller is sharing a real variable, not a temporary.