The OpenD Programming Language

Throw.onOverflow

Called automatically upon an overflow during a unary or binary operation.

  1. typeof(~Lhs()) onOverflow(Lhs lhs)
  2. typeof(Lhs() + Rhs()) onOverflow(Lhs lhs, Rhs rhs)
    struct Throw
    static
    typeof(Lhs() + Rhs())
    onOverflow
    (
    string x
    Lhs
    Rhs
    )
    (
    Lhs lhs
    ,
    Rhs rhs
    )

Parameters

x

The operator, e.g. -

lhs Lhs

The left-hand side (or sole) argument

rhs Rhs

The right-hand side type involved in the operator

Return Value

Type: typeof(Lhs() + Rhs())

Nominally the result is the desired value of the operator, which will be forwarded as result. For Throw, the function never returns because it throws an exception.

Throws

CheckFailure on overflow

Meta