using System; public class Test{ readonly int X; private void Init() { X = 1; } public Test() { Init(); } public static void Main() { new Test(); }}
Standard input is empty
prog.cs(6,24): error CS0191: A readonly field `Test.X' cannot be assigned to (except in a constructor or a variable initializer) Compilation failed: 1 error(s), 0 warnings
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!