Hi, what do you think should have been in lieu of runtime error?
Thanks,
/* No compile error for v2 & v3
*
* Runtime Error:
* Segmentation fault (core dumped)
*
* Compiler:
* rdmd playground.d
*/
struct Ana
{
char a;
// Kedi k; // assertions complated
union
{
char b;
char p;
}
//Kedi k; // #.v2 (compiled it)
union Kedi
{
char cat;
char edi;
}
//Kedi k; // #.v3 (compiled it)
}
Ana ana = {
97,
k : Ana.Kedi(107),
98
};
// ana.writeln(", ", ana.k.edi);
// Ana('a', Kedi, #{overlap b, p}), k
with(ana)
{
assert(b == 'b'); // 'b' == 98
assert(b == p); // p == 'b'
assert(k.cat == 'k'); // 'k' == 107
assert(k.cat == k.edi); // k.edi == 'k'
}
SDB@79