[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 Walter Brightchanged: What|Removed |Added See Also||https://issues.dlang.org/sh ||ow_bug.cgi?id=11970 --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 Mike Franklinchanged: What|Removed |Added Status|NEW |RESOLVED CC||slavo5...@yahoo.com Resolution|--- |DUPLICATE --- Comment #5 from Mike Franklin --- *** This issue has been marked as a duplicate of issue 11970 *** --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 Sebchanged: What|Removed |Added Keywords||pull CC||greensunn...@gmail.com --- Comment #4 from Seb --- I agree that this is a very common error. Let's try to get it in DMD first: https://github.com/dlang/dmd/pull/8119 --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 Vladimir Panteleevchanged: What|Removed |Added Keywords||diagnostic Component|dlang.org |dmd --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 --- Comment #3 from David Baum--- @greenify -- thanks for the DScanner issue. I really appreciate it. --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 greenifychanged: What|Removed |Added CC||greeen...@gmail.com --- Comment #2 from greenify --- You probably have better chances of getting this into DScanner: https://github.com/dlang-community/D-Scanner/issues/497 --
[Issue 17626] Same name variable assignment should raise a compile-time warning
https://issues.dlang.org/show_bug.cgi?id=17626 David Baumchanged: What|Removed |Added Summary|Same name variable |Same name variable |assignment should be|assignment should raise a |prohibited |compile-time warning --- Comment #1 from David Baum --- I would like to suggest having the following code raise a compile-time warning: ``` x = x; ``` Other than invoking the copy constructor, this is a no-op. I had the following piece of code, which for "some reason" didn't work: ``` struct FuncPtr{ void* ptr; this(void* ptr){ ptr = ptr; } ... } ``` Locating this wasn't immediate, and I don't see valid reasons for someone to purposely write such a code. I suggest at least raising a compile-time warning. Much easier than to hunt for nulls in runtime. --