NAME

promote - determine promoted type of two types

SYNOPSIS

type1.promote(type2)

DESCRIPTION

The promote() method determines the common type that both type1 and type2 can be safely promoted to for arithmetic or comparison operations.

RETURN VALUE

A Type value representing the promoted type, or nil if no promotion is possible.

ERRORS

ArgCheck if exactly one argument is not provided.
TypeCheck if the arguments are not types.

EXAMPLE

    typeof(1).promote(typeof(1.5))
Float

SEE ALSO

typeof
packtype