Interesting info, I've never seen this behavior in C since the
conversion is implicit as [2] notes. A simple cast resolves the
problem in D:
module main;
int main(string[] argv){
short asd = 1;
short qwe = cast(short)(asd + asd);
return 0;
}
Thanks for your answer :)
On 06/23/2014 10:03 PM, David Zaragoza wrote:> Hello
>
> I'm trying to compile the following program:
>
> module main;
>
> int main(string[] argv){
> short asd = 1;
> short qwe = asd + asd;
> return 0;
> }
>
> And the compiler gives this error:
>
> C:\David>dmd simple
> simple.d(5):