On Sunday, June 16, 2013 05:14:07 Tyro[17] wrote:
> The following code:
> 
> void main()
> {
>       import std.bigint;
>       BigInt x, m;
>       BigInt l = x & m;
> }
> 
> Result in:
> andrew@ace:~$ dmd f
> f.d(6): Error: 'x' is not of integral type, it is a BigInt
> f.d(6): Error: 'm' is not of integral type, it is a BigInt
> 
> I'm sure there is plans to resolve this situation but is there a work
> around I can use in the meantime?

As far as the compiler is concerned, BigInt isn't an integral type. It's a 
user-defined type. But the problem isn't really whether it's an integral type 
or not. The problem is that it doesn't overload opBinary with the & operator. 
It overloads it for +, -, *, /, and % but not for any of the bitwise 
operators. So, arguably the error message needs some improvement.

Regardless, if you want that functionality, you'll have to open an enhancement 
request for it: http://d.puremagic.com/issues

- Jonathan M Davis

Reply via email to