function overload

Several signatures declared for one function, each describing a different allowed combination of argument and return types.

In more detail

Overloads help when behaviour really differs by input, but writing one per type is tedious and misses new types. A generic signature is usually simpler when the output type just follows the input type.

Related terms

Taught in

References