Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 02:32:32 Per Nordlöw via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: > > Are people using self assignment of structs as a way of > > force-running the postblit? Is there a valid use case for that? > > > > Mike > > If

Re: Warning on self assignment

2018-04-25 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 03:32:09 UTC, Meta wrote: On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote: On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: Are people using self assignment of structs as a way of force-running the postblit? Is there a valid use

Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 02:23:04 Mike Franklin via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 01:08:46 UTC, Arun Chandrasekaran > > wrote: > > So I was telling my colleague that D would warn on self > > assignment, but found that I was wrong. > > > >

Re: Warning on self assignment

2018-04-25 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, April 25, 2018 03:32:09 Meta via Digitalmars-d-learn wrote: > On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote: > > On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin > > > > wrote: > >> Are people using self assignment of structs as a way of > >> force-running

Re: Warning on self assignment

2018-04-24 Thread Mike Franklin via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 01:20:13 UTC, Mike Franklin wrote: It appears a bug has already been filed (https://issues.dlang.org/show_bug.cgi?id=11970). I'll see if I can fix it. https://github.com/dlang/dmd/pull/8208 We'll see what happens.

Re: Warning on self assignment

2018-04-24 Thread Meta via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 02:32:32 UTC, Per Nordlöw wrote: On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: Are people using self assignment of structs as a way of force-running the postblit? Is there a valid use case for that? Mike If they are, there should be a

Re: Warning on self assignment

2018-04-24 Thread Per Nordlöw via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 02:23:04 UTC, Mike Franklin wrote: Are people using self assignment of structs as a way of force-running the postblit? Is there a valid use case for that? Mike If they are, there should be a better way of force-running the postblit.

Re: Warning on self assignment

2018-04-24 Thread Mike Franklin via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 01:08:46 UTC, Arun Chandrasekaran wrote: 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

Re: Warning on self assignment

2018-04-24 Thread Mike Franklin via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 01:08:46 UTC, Arun Chandrasekaran wrote: 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

Warning on self assignment

2018-04-24 Thread Arun Chandrasekaran via Digitalmars-d-learn
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);