I use dscanner to lint my code and find it helpful.

However, in GtkD there are several functions which take ref args, and these confuse dscanner.

For example:

        uint kv;
        event.getKeyval(kv); // ref arg is updated here

dscanner incorrectly (but understandably) reports:

Variable kv is never modified and could have been declared const or immutable.

If D allowed the _optional_ use of ref at the call site:

        uint kv;
        event.getKeyval(ref kv);

Then this would not only help dscanner, but also make it clear to programmers that the argument could be modified.

(This is done in Rust with f(&mut arg), and I certainly find it helpful.)

Reply via email to