12.2.6 Return-value congruence

Like parameter lists, the value declarations of a generic function and that function's methods must be congruent. The rules depend on whether the generic function returns a fixed or a variable number of values:

The following value declarations are congruent, because the generic function implicitly returns any number of values of any type:

define generic g (arg1 :: <complex>, arg2 :: <integer>);
define method g
    (arg1 :: <real>, arg2 :: <integer>) => (result :: <real>)
  ...
end method g;

The following value declarations are not congruent, because the type of the method's returned value is not a subtype of the generic function's returned value:

define generic g
    (arg1 :: <complex>, arg2 :: <integer>) => (result :: <integer>);
define method g
    (arg1 :: <real>, arg2 :: <integer>) => (result :: <real>)
  ...
end method g;