to repro, from $(DMD_SVN_ROOT)/src/test: make test_results/fail_compilation/fail37.d.out or: ../src/dmd -Ifail_compilation -odtest_results/fail_compilation -oftest_results/fail_compilation/fail37 -c fail_compilation/fail37.d The code: ulong[cast(uint)((cast(float)int.sizeof/ulong.sizeof)-int.max>>2)+int.max>>2] hexarray; The assert: fail_compilation/fail37.d(1): Error: 'cast(float)4u / cast(float)8u - cast(float)2147483647' is not of integral type, it is a float dmd: constfold.c:590: Expression* Shr(Type*, Expression*, Expression*): Assertion `0' failed.
Reduced test case: ulong [undefined>>1] hexarray; ulong [undefined>>>1] hexarray2; It doesn't fail with [undefined<<1] This is caused by the error propagation introduced in 2.047. PATCH constfold.c, Shr(), line 589 case Tuns64: value = (d_uns64)(value) >> count; break; + case Terror: + return e1; default: assert(0); } And exactly the same for UShr() line 630.
*** Issue 4792 has been marked as a duplicate of this issue. ***
http://www.dsource.org/projects/dmd/changeset/670