diff --git a/src/dscanner/analysis/unused.d b/src/dscanner/analysis/unused.d index 5740ac3..6dd7259 100644 --- a/src/dscanner/analysis/unused.d +++ b/src/dscanner/analysis/unused.d @@ -79,6 +79,13 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer mixin PartsUseVariables!ThrowExpression; mixin PartsUseVariables!CastExpression; + override void dynamicDispatch(const ExpressionNode n) + { + interestDepth++; + super.dynamicDispatch(n); + interestDepth--; + } + override void visit(const SwitchStatement switchStatement) { if (switchStatement.expression !is null) diff --git a/src/dscanner/analysis/unused_variable.d b/src/dscanner/analysis/unused_variable.d index 176477c..2532562 100644 --- a/src/dscanner/analysis/unused_variable.d +++ b/src/dscanner/analysis/unused_variable.d @@ -125,6 +125,12 @@ final class UnusedVariableCheck : UnusedStorageCheck __traits(isPOD); } + void unitthreaded() + { + auto testVar = foo.sort!myComp; + genVar.should == testVar; + } + }c, sac); stderr.writeln("Unittest for UnusedVariableCheck passed."); }