On Sunday, 23 February 2020 at 12:28:41 UTC, mark wrote:
On Sunday, 23 February 2020 at 09:35:30 UTC, Jacob Carlborg
wrote:
On 2020-02-23 10:03, mark wrote:
Then this would not only help dscanner, but also make it
clear to programmers that the argument could be modified.
It's not necessary f
On Sunday, 23 February 2020 at 09:03:56 UTC, mark wrote:
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.)
C# also does it, and uses exactly the same key
On 2020-02-23 13:28, mark wrote:
Just realised that the arg is 'out' not 'ref'; don't know if that makes
a difference to dscanner. Anyway, I've made a bug report:
https://github.com/dlang-community/D-Scanner/issues/793
Same idea applies. dscanner should look at the signature. In the case of
On Sunday, 23 February 2020 at 09:35:30 UTC, Jacob Carlborg wrote:
On 2020-02-23 10:03, mark wrote:
Then this would not only help dscanner, but also make it clear
to programmers that the argument could be modified.
It's not necessary for dscanner. It should look at the
signature of `getKeyva
On 2020-02-23 10:03, mark wrote:
Then this would not only help dscanner, but also make it clear to
programmers that the argument could be modified.
It's not necessary for dscanner. It should look at the signature of
`getKeyval` to see that it takes an argument by `ref`.
--
/Jacob Carlborg
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:
Vari