D-Scanner
D-Scanner copied to clipboard
Report of unused_variable_check is incorrect
This code should not warn Variable a is never used.
@safe unittest {
int a;
static assert(is(typeof(a)));
}
Workaround:
@safe unittest
{
miixn(q{ int a; });
static assert(is(typeof(a)));
}
But it is not desirable to use this method too much, as it silences everything. And the burden on the compiler due to the string mixin is also a concern.