struct Array(E) {
E[] elements;
~this() {
foreach (e; this.elements) e.destroy();
}
}
struct Node {Object value;}
struct Object {Array!Node values;}
> issue.d(5): Error: struct `issue.Node` no size because of forward reference
Actions that suppress the issue:
- removing the line of code in the destructor's body
- changing `~this()` to `void destroy()` and calling it manually
- removing the type parameter and replacing `E` by `Node`
- moving `Object.values` into `Node`.
Comment #1 by robert.schadek — 2024-12-13T19:34:28Z