Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.


Compile-time checks associated with the @mustuse attribute.

Source mustuse.d

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
true on error, false on success.
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