Better Method Overload in Managed COBOL

Suppose we have an argument list A with a set of argument types (A1, A2,…An) and two applicable method overloads Mp and Mq with parameter types (P1…Pn) and (Q1,…Qn), where if necessary the parameters have been converted to expanded form (see above).

Then, Mp is said to be a better method overload than Mq if both the following are true:

  • For each argument, the implicit conversion from Ax to Px is not worse than the conversion from Ax to Qx (see below for definition of better conversion)
  • There is at least one argument for which the conversion from Ax to Px is better than the conversion from Ax to Qx

Suppose we have two conversions, from type S to types T1 and T2, then T1 is the better conversion when T1 and T2 are as follows:

T1 is: And T2 is one of:
same as S anything
binary-char
  • binary-char unsigned
  • binary-short unsigned
  • binary-long unsigned
  • binary-double unsigned
binary-short
  • binary-short unsigned
  • binary-long unsigned
  • binary-double unsigned
binary-long
  • binary-long unsigned
  • binary-double unsigned
binary-double
  • binary-double unsigned

Otherwise neither conversion is better.