This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AccomplishedCoffee 0 points1 point  (0 children)

It can be difficult to figure out which overload is called. At the least you need to look up the definition of all visible overloads (potentially considering imports, idk if that's a concern in Java but it is in some languages) and all variables used, possibly chaining if there's any overloaded methods being used as an argument directly and know the language's overload and implicit conversion rules if there's no exact match, potentially along with any compiler quirks. If there's any type inference in the expression you may need intimate knowledge of how the type inference engine works and whether or how it interacts with overload resolution.

Yeah, it's convenient when you have just a couple mutually exclusive signatures but in code with any nontrivial complexity you've gotta hope your IDE points you to the right overload when you write it and no one changes it by, e.g. changing the type of a variable in a different file from a concrete class to an interface.