Been experimenting with delayed and grouped allocations of multiple slices, and came upon a question I hadn't considered before. Suppose an unallocated slice is made:
var a: []i32 = undefined;
we can obtain the type of "a" using @TypeOf(a), which returns "[]i32" but how can we obtain the type of the elements of this slice?
Just realized that one could use:
@TypeOf(a[0])
or even
@TypeOf(a[9999])
both return "i32" even though nothing has been allocated.
So, is there any danger to using this? Is there a better way?