Struct containing a list of itself?
Hi, I'm trying to creating a node-like tree which can contain a child (or children), but the mojo compiler doesn't really let me do that:
error: function has recursive call to 'always_inline' function
struct Node:
^
Mojo/USL/shaderlab/libutils/utils_methods.mojo:87:8: note: through call here
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/stdlib/collections/list.mojo:186:8: note: to function marked 'always_inline' here
/Users/ec2-user/actions-runner/_work/modular/modular/Kernels/mojo/stdlib/memory/unsafe_pointer.mojo:413:9: note: call here recurses
Mojo/USL/shaderlab/libutils/utils_methods.mojo:87:8: note: back to function here
struct Node:
^
mojo: error: failed to run the pass manager
2 Replies