fix unused variable check for unitthreaded checks
such as `a.should == b`
This commit is contained in:
parent
c8262f4220
commit
a958f9ac7b
|
@ -79,6 +79,13 @@ abstract class UnusedIdentifierCheck : BaseAnalyzer
|
||||||
mixin PartsUseVariables!ThrowExpression;
|
mixin PartsUseVariables!ThrowExpression;
|
||||||
mixin PartsUseVariables!CastExpression;
|
mixin PartsUseVariables!CastExpression;
|
||||||
|
|
||||||
|
override void dynamicDispatch(const ExpressionNode n)
|
||||||
|
{
|
||||||
|
interestDepth++;
|
||||||
|
super.dynamicDispatch(n);
|
||||||
|
interestDepth--;
|
||||||
|
}
|
||||||
|
|
||||||
override void visit(const SwitchStatement switchStatement)
|
override void visit(const SwitchStatement switchStatement)
|
||||||
{
|
{
|
||||||
if (switchStatement.expression !is null)
|
if (switchStatement.expression !is null)
|
||||||
|
|
|
@ -125,6 +125,12 @@ final class UnusedVariableCheck : UnusedStorageCheck
|
||||||
__traits(isPOD);
|
__traits(isPOD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void unitthreaded()
|
||||||
|
{
|
||||||
|
auto testVar = foo.sort!myComp;
|
||||||
|
genVar.should == testVar;
|
||||||
|
}
|
||||||
|
|
||||||
}c, sac);
|
}c, sac);
|
||||||
stderr.writeln("Unittest for UnusedVariableCheck passed.");
|
stderr.writeln("Unittest for UnusedVariableCheck passed.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue