<div dir="ltr">I belive this is a bug or it should be fixed and do same as C does.<div><br></div><div><div>import std.stdio;</div><div><br></div><div>void main()</div><div>{</div><div>    uint total = 0;</div><div>    byte popCount() { return 5; }</div><div><br></div><div>    writeln(total + popCount() - popCount());</div><div>}</div></div><div><br></div><div>works as expected</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 11, 2017 at 9:57 PM, Johan Engelen via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, 11 July 2017 at 19:46:00 UTC, Johan Engelen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The Weka folks would like to see a compile error on negating unsigned types:<br>
</blockquote>
<br></span>
Also this nice hackery would need a workaround:<br>
```<br>
   if ((y&(-y))==y)<br>
```<br>
<br>
<br>
</blockquote></div><br></div>