On Friday, October 21, 2011 12:20:02 Tobias Brandt wrote: > On 21 October 2011 10:01, Jonathan M Davis <jmdavisp...@gmx.com> wrote: > > On Friday, October 21, 2011 11:57:50 Gor Gyolchanyan wrote: > >> That's because implicit casts in D are much more strict, then those in > >> C/C++. Such seemingly intuitive cats, e.g. from long to int are not > >> performed due to potential loss of data. > >> Casting from int to uint has the same effect of potential loss of > >> data. > > > > In D, integral types implicitly convert to their unsigned counterparts > > and vice versa. D does not consider those conversions to be narrowing > > conversions which require a cast (though they _are_ narrowing > > conversions and do risk messing up the number if it's too large or too > > small). > > Obviously, the conversion does happen implicitly, otherwise > 'new A!1' wouldn't compile (A expects a uint as parameter). > But then, why are A!1 and A!1u different types?
I believe that it's a bug in the compiler. - Jonathan M Davis