3 ms·
No, but I think that was a good choice. In local code this is great, but in an interface contract being explicit about data type is a virtue.
by ivan_gammel 4y ago
No, but I think that was a good choice. In local code this is great, but in an interface contract being explicit about data type is a virtue.
- andix 4y agoFor interfaces this would obviously not work (there is no implementation). But for class members it would. I think this concept works very well in typescript and F#.
- ivan_gammel 4y agoI mean interface not as a language construct, but as a declaration of how module (class, component etc) can be used. You want to see the type in such declaration, not to infer it based on implementation details.
- gpderetta 4y agoBut rust still allows declaring returning a trait instead of explicit types.