using System; public class Test{ public readonly string field = "foo"; public static void Main() { var t = new Test(); t.field = "bar"; }}
Standard input is empty
prog.cs(10,11): error CS0191: A readonly field `Test.field' 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!