Previous Topic Next topic Print topic


COBCH1708 More than one method <method-name> exists in <class-name> requiring parameter truncation

Method invocation has identified more than one possible target method, and those targets may result in parameter truncation.

An ambiguity exists because a method invoke could be satisfied by two target methods, both of which would require possible parameter truncation. The normal search for a best method is only applicable when no parameter truncation is required.

In the following example, the n1 field of type binary-double could possibly be truncated when passed into either method and converted to either binary-char or binary-short. In this circumstance, you must ensure that the types are compatible, in a way that no truncation occurs.

class-id a.
method-id main static.
declare n1 as binary-double
invoke self::m(n1)
end method.

method-id m static.
procedure division using by value n as binary-char.
 display n
end method.

method-id m static.
procedure division using by value n as binary-short.
 display n
end method.
end class.
Previous Topic Next topic Print topic