1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
// CS0192: A readonly field `A.a' cannot be passed ref or out (except in a constructor) // Line: 17 using System; class A { public readonly int a=5; public void Inc (ref int a) { ++a; } public void IncCall () { Inc (ref a); } static void Main () { } }