Sometimes I have the “overload” keyword after a method that’s not overloaded.
Besides readability and maintainability of the code, does this have any other impact that I should be aware of?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The big difference is that when the arguments to a method are incorrect, the error message is significantly better for a non-overloaded method.
More subtly, an overloaded method may be overloaded with functions you have no knowledge of. Consider the standard
IfThenfunction.StrUtils.IfThenexists exactly once:yet it is marked as
overload. That’s because it’s overloaded withMath.IfThen, and if a single unit uses bothMathandStrUtils, an unqualifiedIfThenwill resolve to the proper function depending on the arguments, and regardless of the order of the units in theuseslist.