I don't understand this bug. D2 code: void main() { enum uint N = 4u; char[] A = "hello".dup; uint[immutable char[N]] dict; dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK dict[*cast(immutable char[N]*)(A[0 .. N].ptr)] = 0; // line 6, error } DMD 2.059head gives: test.d(6): Error: cannot implicitly convert expression (*cast(immutable(char[N]*))cast(char*)A[0u..4u]) of type immutable(char[N]) to immutable(char[4u])
https://github.com/D-Programming-Language/dmd/pull/838
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/555bb0d25c908fb2811c665372510b529088c814 Merge pull request #838 from 9rnsr/fix7621 Issue 7621 - Immutable type equivalence problem