Traits for Static Dispatch

While agreeing something maybe should change regarding anytype / interfaces, I also think flexibility should be preserved. Currently we can literally just put anything in an anytype and the compiler figures it out.
What if anytype should be a u8 or u16? Should we have a trait for that?

I think it is a very very difficult problem. Before we know we would get into Rust-like unreadable stuff. I cannot visualize any good + simple + readable syntactical solution better than the current one with anytype.

5 Likes