Comment #0 by bearophile_hugs — 2012-10-17T13:39:56Z
import std.bigint: BigInt;
void main() {
auto r1 = BigInt(10) / true;
auto r2 = BigInt(10) /= true;
}
DMD 2.061alpha gives:
...\dmd2\src\phobos\std\bigint.d(135): Error: operation not allowed on bool 'y'
...\dmd2\src\phobos\std\bigint.d(258): Error: template instance std.bigint.BigInt.opOpAssign!("/",bool) error instantiating
test.d(3): instantiated from here: opBinary!("/",bool)
test.d(3): Error: template instance std.bigint.BigInt.opBinary!("/",bool) error instantiating
If this operation is not allowed, then maybe it's better to disallow it statically (maybe with a template constraint), to give a nicer/more clean error message.
Comment #1 by andrej.mitrovich — 2013-02-04T13:08:07Z