ABL always searches for an exact parameter match, but if none is found, it will accept the closest parameter match according to widening in the available method or constructor overloads at compile time. Failure to find a match raises a compile-time error. For more information on matching parameter data types with widening, see the Parameter passing syntax reference entry in ABL Reference.

The examples that follow show how widening can resolve calls to overloaded methods (or constructors):

CLASS Widening:
/* 1 */ METHOD PUBLIC VOID setVal (INPUT piVal AS INTEGER):
        END METHOD.

/* 2 */ METHOD PUBLIC VOID setVal (INPUT pdVal AS DECIMAL):
        END METHOD.
END CLASS.

When the following procedure calls the setVal( ) method with a given parameter, the overloaded method definition that it matches corresponds to the bold-faced number referenced in the comments:

VAR CLASS Widening rWid.
VAR INT iVal  = 42.
VAR INT64 i64Val = 42.
VAR DECIMAL dVal = 4.2.

rWid = NEW Widening( ).

rWid:setVal(iVal).   /* Calls 1 - matches exactly                 */
rWid:setVal(i64Val). /* Calls 2 - INT64 matches the wider DECIMAL */
rWid:setVal(dVal).   /* Calls 2 - matches exactly                 */