Pass a slice as a default value ptr to a comptime generated struct field

No stack traces, no compiler errors, but I did figure it out just now. Yay!

The problem was that I was passing a slice to a var array. When I changed it to const, it works as a charm! I remembered this topic I read today Comptime-Mutable Memory Changes by mlugg.

I will post the full code when finished, recreate the error. Maybe someone can take a look and see if I was just doing dumb things, if the compiler could have helped me more, or both :slight_smile:

1 Like