COBCH1494 Method method-name cannot OVERRIDE an inherited method with different return type.

The program contains a method that overrides another method in an inherited class, but has a different return type than the inherited method. This is not allowed.

Resolution:

Correct the code such that the return type for both the overriding method and the inherited method match; then recompile

Example:

The following example shows that method M1 overrides a binary-long return type with a string return type. This is not allowed.

       class-id A1.
       method-id M1 returning ret as binary-long.
       end method.
       end class.
       class-id A2 inherits type A1.
       method-id M1 override returning ret as string.
       end method.
       end class.