http://d.puremagic.com/issues/show_bug.cgi?id=11440
Summary: struct initialization with partially initialized data
crashes
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Daniel Davidson <[email protected]> 2013-11-04 11:22:54
PST ---
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.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------