You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current diagnostics of unused variables is incomplete and gives false positives because it doesn't take into account the possibility of values passed to a ref-parameter of a function f can being mutated inside the f. For instance
voidinc(T)(ref T x) {
x =+1;
}
@safepureunittest {
int x = 1;
inc(x);
assert(x ==2);
}
gives warning
Variable x is never modified and could have been declared const or immutable.
but shouldn't.
The text was updated successfully, but these errors were encountered:
The current diagnostics of unused variables is incomplete and gives false positives because it doesn't take into account the possibility of values passed to a ref-parameter of a function
f
can being mutated inside thef
. For instancegives warning
Variable x is never modified and could have been declared const or immutable.
but shouldn't.
The text was updated successfully, but these errors were encountered: