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
What are thoughts on issuing a warning when accessing a member variable without going through the this reference?
struct A {
int i;
this(int i)
{
i = i; // <-- Warning
this.i = i; // <-- Ok
}
}
My request is motivated by the specific issue highlighted in this example, but this check in general would remove some ambiguities, especially in constructors (I don't know easy it would be to limit the check to constructors, though).
It would surely be extremely noisy for most projects, so maybe would make most sense to be disabled by default.
The text was updated successfully, but these errors were encountered:
What are thoughts on issuing a warning when accessing a member variable without going through the
this
reference?My request is motivated by the specific issue highlighted in this example, but this check in general would remove some ambiguities, especially in constructors (I don't know easy it would be to limit the check to constructors, though).
It would surely be extremely noisy for most projects, so maybe would make most sense to be disabled by default.
The text was updated successfully, but these errors were encountered: