Puzzling behavior of "wrong" inner constructor

You can call new() with fewer arguments than the struct has fields and those fields will be uninitialized. For reference type fields that are represented as pointers, these appear as undef which is a non-value that’s an error to access in any way. For value type fields like you have here, the uninitialized fields will contain uninitialized memory, so basically just some random junk. (This junk value looks like it could maybe be a pointer reinterpreted as a float.)

2 Likes