If Rust had return type inference, it would be close to my ideal language
-
-
Those unreadable errors come up when modifying the body of the function, not using it. So I often end up writing the return type anyway. Also, writing the return type helps me make sure I’m returning the right thing.
-
> writing the return type helps me ... I think there's an argument to be made here if Rust added the inference, in that your public API should require explicit types, but private functions can support inference
- 5 more replies
New conversation -
-
-
Inference is often bound to make some errors worse, since some errors will move to use site or to later calls. But tool support to autocomplete the return type would probably be a nice compromise.
-
Return type inference does not imply making type inference program-wide
End of conversation
New conversation -
-
-
Interesting, because I think most type inference mechanisms go with the strategy of "most generic type possible" which often results in "anonymous type satisfying a set of typeclasses/traits/interfaces/etc"
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.