Warning on self assignment

Arun Chandrasekaran aruncxy at gmail.com
Wed Apr 25 01:08:46 UTC 2018


So I was telling my colleague that D would warn on self 
assignment, but found that I was wrong.

https://run.dlang.io/is/HLhtek

```
module a;

import std.stdio;

void main() {
     string a;
     a = a;          // Can the compiler warn at this line that 
there is no effect?
     writeln(a);
     return;
}
```


More information about the Digitalmars-d-learn mailing list