|
|
|
|
|
by masklinn
3376 days ago
|
|
> Java needs to be able to decide which overloaded method implementation to use at compile time, meaning you can't differentiate between method implementations based on return type alone. That's not correct. Rust has no issue statically dispatching based on the return type. Java-the-language does not allow it so it does not have to deal with calls which don't use the return value e.g. int getSomething()
String getSomething()
If the return value is not used, you have to explicitly disambiguate this call somehow, and Java provides no way to do so. |
|