News for hackers. Stuff that matters.
Re:Swift: Madness of Generic Integer by alricb on Tuesday March 03, 2015 @06:34PM (#9141557)
But in this case, it isn't. Two's complement signed fixed-size integers are completely different from their unsigned brethren, and confusing them is an endless source of bugs.
Re:Swift: Madness of Generic Integer by pcwalton on Tuesday March 03, 2015 @06:35PM (#9141562)
> But in this case, it isn't. Two's complement signed fixed-size integers are completely different from their unsigned brethren, and confusing them is an endless source of bugs.

They both support a meaningful left-bitshift operation, which is what the author wanted to abstract over.

Re:Swift: Madness of Generic Integer by tacos on Tuesday March 03, 2015 @06:53PM (#9141662)
But they do not support a common right-bitshift operation, nor sign extend. Which is what both the compiler and the poster above you are trying to make clear.
Re:Swift: Madness of Generic Integer by viraptor on Tuesday March 03, 2015 @07:05PM (#9141756)
Interface providing generic left-shift doesn't have to provide right-shift at the same time. And after the shift, what the compiler is complaining about is not the arithmetics but only type construction.