On Sunday, 8 April 2018 at 15:51:05 UTC, Paul Backus wrote:
On Sunday, 8 April 2018 at 15:04:49 UTC, number wrote:
writeln(s2); // S2(0, null)
S2 is a nested struct , which means it has a hidden pointer
field that's used to access its enclosing scope. If you change
the definition to `static struct S2`, you'll get the same
output for both structs.
Aha, its the nesting. And if i access the outer scope in the
function its not null anymore.