You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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).
Daniel Davidson reported this on 2013-11-04T11:22:54Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=11440
CC List
Description
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.The text was updated successfully, but these errors were encountered: