dmd.canthrow

Perform checks for nothrow.

Specification: Nothrow Functions

Authors

Walter Bright

Source: canthrow.d

  • CT

    Declaration

    enum CT: BE;

    Status indicating what kind of throwable might be caused by an expression.

    Discussion

    This is a subset of BE restricted to the values actually used by canThrow.

    • Declaration

      none

      Never throws an Exception or Throwable

    • Declaration

      exception

      Might throw an Exception

  • Declaration

    BE canThrow(Expression e, FuncDeclaration func, bool mustNotThrow);

    Returns true if the expression may throw exceptions. If 'mustNotThrow' is true, generate an error if it throws