Referencing other structs in an array at comptime

Hi @dimdin!

Thanks for the reply. I will absolutely change the pointer to an optional when needed I just made that quick for the example since it isn’t really nullable, more just waiting to be initialized.

As for making the list available to a greater scope that does kind of help but my main goal here is to have the contents of list be available at runtime.
In order to get it passing to the function I had to change the function a bit and write the test like this:

test "Self Ref Test" {
    comptime var list: BoundedSR10 = try BoundedSR10.init(0);
    const fakeReffingData = comptime generateSelfRefData(&list);
    print("{any}", .{fakeReffingData});
}

But I think this just makes the problem more visible. The items inside of list point to other items in list. List is a comptime var. I want to use the contents of list at runtime. Because of the recent changes we can’t have references to comptime vars at runtime, hence I’m looking for help on how to transfer the contents of list into a constant array once I’m done generating them, and keep their references to each other, just in the context of this new array.

It might not be possible but that’s ok.
Again super apprecieate the help and the tips on scope and optional.