UnusedResultChecker

Checks for function call statements which call non-void functions.

In case the function returns a value indicating success/failure, ignoring this return value and continuing execution can lead to undesired results.

When the return value is intentionally discarded, cast(void) can be prepended to silence the check.

Constructors

this
this(string fileName, const(Scope)* sc, bool skipTests)

Members

Aliases

visit
alias visit = BaseAnalyzer.visit
Undocumented in source.

Functions

visit
void visit(const(ExpressionStatement) decl)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin AnalyzerInfo!"unused_result"
Undocumented in source.

Variables

void_
const(DSymbol)* void_;
Undocumented in source.

Inherited Members

From BaseAnalyzer

getName
string getName()
Undocumented in source. Be warned that the author may not have intended to support it.
messages
Message[] messages()
Undocumented in source. Be warned that the author may not have intended to support it.
visit
alias visit = ASTVisitor.visit
Undocumented in source.
visit
void visit(Unittest unittest_)

Visits a unittest.

inAggregate
bool inAggregate;
Undocumented in source.
skipTests
bool skipTests;
Undocumented in source.
visitTemplate
template visitTemplate(T)
Undocumented in source.
addErrorMessage
void addErrorMessage(size_t line, size_t column, string key, string message)
Undocumented in source. Be warned that the author may not have intended to support it.
fileName
string fileName;

The file name

sc
const(Scope)* sc;
Undocumented in source.
_messages
MessageSet _messages;
Undocumented in source.

Meta