class A { foo : int; public this () { def bar (x) { foo = x; // E: assignment to immutable field } if (1 == 1) bar (1); else bar (2); } } class B { foo : int; meth : int -> void; public this () { def bar (x) { foo = x; // E: assignment to immutable field } if (1 == 1) bar (1); else bar (2); meth = bar; } } class C { foo () : void { def x = 1 :: []; x.tl = [2]; // E: needed a writable location for assignment target, got a reference to field `tl', which is read-only } } struct Str { public this(x : int) { base = x // E: needed a writable location for assignment target } }