typeof(string.front) should be char

Piotr Szturmaj bncrbme at jadamspam.pl
Fri Mar 2 18:30:16 PST 2012


Hello,

For this code:

     auto c = "test"c;
     auto w = "test"w;
     auto d = "test"d;
     pragma(msg, typeof(c.front));
     pragma(msg, typeof(w.front));
     pragma(msg, typeof(d.front));

compiler prints:

dchar
dchar
immutable(dchar)

IMO it should print this:

immutable(char)
immutable(wchar)
immutable(dchar)

Is it a bug?


More information about the Digitalmars-d-learn mailing list