Just lost the best part of an hour figuring the cause of this small problem, consider:

void main()
{
        uint j = 42;
        ulong k = 1<<cast(ulong)j;
        ulong m = 1UL<<j;
        assert(k == 1024);//both asserts do pass
        assert(m == (1UL<<42));
}

I though left operand should be promoted to the largest integer in shift expression, isn't it?

--
Dmitry Olshansky

Reply via email to