If you retain the slice and pass it around, it might crash your program or cause undefined behavior.
Isn’t that true of StaticArray
or struct
that returns a Slice
?
To remedy this could a no reference
property be part of a type? Or subtype? Or function call? I’m not sure how the compiler works or how the feature would be best implemented.