If more than one signature declaration is both accessible and applicable to
a signature invocation, it is necessary to choose one. The XL
programming language follows the Java programming language and chooses
the most specific signature. This term is defined
in the Java Language Specification for method signatures
and based on a pairwise comparison of method declarations: Let
m
and n
be two
signature declarations, then m
is
less specific
than n
with respect to the arguments
of the invocation if and only if one of the following is true:
m
has less parameters than
n
.
The signatures are equal and
m
is not more specific than
n
according to the Java language
specification.
n
is more specific
than m
with respect to
the arguments, and
m
is not more specific
than n
with respect to
the arguments. A signature is more specific
than another with respect to arguments if all of the following is true:
For every parameter, it is true that there exists a method invocation conversion to the type of the corresponding parameter of the other signature, or that it has a primitive type and the other parameter has a reference type.
The number of widening
double
-to-float
conversions (see Section 8.1, “Widening Primitive Conversions”) from the arguments
to the signature parameters is less than this number for
the other signature, or if these numbers are equal, the number of
widening primitive conversions to double
from the arguments to the signature
parameters is less than or equal to this number for the other signature.
Now a signature is more specific than another in the sense of the Java programming language if it is not less specific than the other. The determination of the most specific signature proceeds as defined in the Java Language Specification for methods.