import std.stdio; struct S { void[] arr; auto f() pure @safe { int[] a = new int[4]; arr = a; return a; } } void main() @safe { S s; immutable a = s.f(); int[] b = (cast(int[])s.arr); writeln(a); b[0] = 1; writeln(a); } http://dpaste.dzfl.pl/13751913d2ff