import std.stdio; struct Y { private immutable(int)[] _data; } struct CFS { double x = 5; Y growth; } void main() { auto s = CFS(1.0); // crash //auto s = CFS(1, Y()); // crash //auto s = CFS(1, Y([])); // works writeln(s); } If x is an int there is no problem. If s is not accessed there is no problem, so it dies in the writeln call.
Can't reproduce both on Linux and Windows x86.
import std.stdio; struct Y { private immutable(int)[] _data; immutable(int)[] _data2; } struct CFS { double x = 5; Y growth; } void main() { auto s = CFS(1.0); writeln(s); } runs. It seems to be more related to the the "private" token.
(In reply to comment #2) > import std.stdio; > > struct Y { > private: > immutable(int)[] _data; > immutable(int)[] _data2; > } > > struct CFS { > double x = 5; > Y growth; > } > > void main() { > auto s = CFS(1.0); > writeln(s); > } > > runs. > > It seems to be more related to the the "private" token. EDIT: BTW either with private: or private{*/two or more declarations/*}
http://forum.dlang.org/post/nlyjuddqfpdkwfkalxax@forum.dlang.org > > It doesn't happen with -O, or when compiled with LDC or GDC. > > And it doesn't happen when building with -m32 (I'm on x86_64 > linux).
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18708 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB