logoalt Hacker News

nasretdinovtoday at 3:26 PM2 repliesview on HN

Generic interfaces are going to be implemented later too if I'm reading correctly. So no real surprises there :). I guess the only surprise yet is that generic interfaces aren't supported, so generic methods physically can't satisfy any interface


Replies

kbolinotoday at 8:58 PM

Generic interfaces already exist. Generic interface methods, which would be relevant, are not planned. The reason is outlined early in the proposal: nobody knows how to implement them efficiently. Rust has the same problem, for what it's worth: dispatchable functions on dyn-compatible traits cannot be generic [1].

[1]: https://doc.rust-lang.org/reference/items/traits.html#r-item...

ncrucestoday at 5:46 PM

I didn't see anything beyond "this doesn't prevent us from doing it" yet.

Did you?