I know I’ve probably used this term a bunch in other blog posts but I don’t think I’ve ever explained what a method signature is.
In Xojo a “method signature” is the unique way Xojo identifies each method so it can know which method you are calling in your code.
So what does that include ?
First off it does NOT include the SCOPE. PRIVATE, PUBLIC, GLOBAL, and PROTECTED are scope modifiers – but they are not part of the signature of a method.
Attributes are also not part of the signature.
And, curiously enough, the return type is NOT part of the signature. While that determines where you can use the method (ie in an expression where a value is expected vs not) it is NOT part of the signature.
The signature includes only the name and parameter list.
It gets a LOT more confusing if your parameter lists have optional or default parameter values since the signature basically can be thought to be “variable” – but its still just the name and parameter list.
And if you ever get an error saying
There is more than one item with this name and it’s not clear to which this refers.
and the compiler has hilighted a method call then the likelihood is you have two signatures that can be treated the same and the compiler cannot figure out which one you really meant to use.
Source: Norman Palardy