https://issues.dlang.org/show_bug.cgi?id=19984
--- Comment #5 from anonymous4 <[email protected]> --- Your example implicitly converts thread local data to shared: --- struct S { int result; int[] data; void inc(int i) shared { result.atomic!"+="(i); } } shared int[] data; int sum(){ S s; s.data=[0,1,2]; foreach(i; iota(1000).parallel){ static assert(is(typeof(s) == shared(S))); s.inc(i); data=s.data; } static assert(is(typeof(s) == S)); assert(s.data[0]==0,"now it's local and shared"); return s.result; } --- --
