diff --git a/src/dscanner/analysis/unused.d b/src/dscanner/analysis/unused.d index 5b06ad2..2686faa 100644 --- a/src/dscanner/analysis/unused.d +++ b/src/dscanner/analysis/unused.d @@ -166,14 +166,9 @@ final class UnusedVariableCheck : BaseAnalyzer override void visit(const AssignExpression assignExp) { - if (assignExp.ternaryExpression !is null) - assignExp.ternaryExpression.accept(this); - if (assignExp.expression !is null) - { - interestDepth++; - assignExp.expression.accept(this); - interestDepth--; - } + interestDepth++; + assignExp.accept(this); + interestDepth--; } override void visit(const TemplateDeclaration templateDeclaration) @@ -542,6 +537,13 @@ private: auto cb2 = delegate(size_t a) {}; // [warn]: Parameter a is never used. cb2(3); } + + void oops () + { + class Identity { int val; } + Identity v; + v.val = 0; + } bool hasDittos(int decl) {