1 struct S 2 { 3 immutable(S)* s; thisS4 this(int) immutable pure 5 { 6 s = &this; 7 } 8 int data; 9 } 10 immutable(S)11immutable(S)* makes() pure 12 { 13 return new immutable S(0); 14 } 15 main()16void main() 17 { 18 S* s = makes(); // s is mutable and contains an immutable reference to itself 19 //s.s.data = 7; // this is immutable 20 s.data = 3; // but this is not!!! 21 } 22