Am 10.02.2012, 19:07 Uhr, schrieb H. S. Teoh <hst...@quickfur.ath.cx>:

I'm not sure whether the following a compiler/language bug or a Phobos
bug, but it's definitely some kind of bug:

        auto s = "abc";
        immutable t = "def";

        writeln(typeid(s));     // immutable(char)[]
        writeln(typeid(t));     // immutable(immutable(char)[])
                                // (what is this supposed to mean?!)

That is supposed to mean that you can neither modify the values of the characters in the array nor the array itself:

t[1] = 'a'; // immutable(char)
t.length = 2; // immutable(...[])

Reply via email to