Previous Topic Next topic Print topic


COBCH1716 Best visible instance overload found in <type-name> is <method-name> which has invalid parameter <param-num>

The specified type has no instance method with matching parameters. The error message shows the method with the best match, and indicates the parameter that fails to match.

In the following example, there is no compatible match for the call to messageStart using the arguments supplied. There is a method with the correct name and same number of parameters; however, the parameter is not a compatible match. Either change the argument to be compatible with a string type, or change the messageStart method to accept a type compatible with a numeric.

class-id myClass2.
method-id main.
 declare messDisplay as type myClass2
 invoke messDisplay::messageStart(2)
end method.
method-id messageStart.
procedure division using by value s as string.
...
end method.
end class.

This error is produced in a context in which an instance method would be allowed.

Previous Topic Next topic Print topic