<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 5 February 2018 at 11:22, H. S. Teoh 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">Code:<br>
<br>
struct S {<br>
byte[2] x;<br>
}<br>
void main() {<br>
S s, t;<br>
s.x = [ 1, -1 ]; // OK<br>
t.x = [ -s.x[0], -s.x[1] ]; // NG (line 7)<br>
}<br>
<br>
<br>
Compiler says:<br>
/tmp/test.d(7): Deprecation: integral promotion not done for `-s.x[0]`, use '-transition=intpromote' switch or `-cast(int)(s.x[0])`<br>
/tmp/test.d(7): Deprecation: integral promotion not done for `-s.x[1]`, use '-transition=intpromote' switch or `-cast(int)(s.x[1])`<br>
<br>
<br>
Why should I need to explicitly cast to int only to reassign it back to<br>
byte?! This is ridiculous.</blockquote><div><br></div><div>Seriously, WTF is going on here?</div></div></div></div>