blob: 28f7befdf91b09b5e543557e3e3e7167c8876d05 [file] [log] [blame]
struct S
{
immutable(S)* s;
this(int) immutable pure
{
s = &this;
}
int data;
}
immutable(S)* makes() pure
{
return new immutable S(0);
}
void main()
{
S* s = makes(); // s is mutable and contains an immutable reference to itself
//s.s.data = 7; // this is immutable
s.data = 3; // but this is not!!!
}