Compile-time checks associated with the @mustuse attribute.

Source: mustuse.d

  • Declaration

    bool checkMustUse(Expression e, Scope* sc);

    Check whether discarding an expression would violate the requirements of @mustuse. If so, emit an error.


    Expression e

    the expression to check

    Scope* sc

    scope in which e was semantically analyzed

    Return Value

    true on error, false on success.

  • Declaration

    void checkMustUseReserved(Dsymbol sym);

    Called from a symbol's semantic to check for reserved usage of @mustuse.


    If such usage is found, emits an errror.


    Dsymbol sym

    symbol to check