Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


For 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#.


I 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.


But rust still allows declaring returning a trait instead of explicit types.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: