dchar issues?

Lionello Lunesu lio at lunesu.remove.com
Thu Apr 20 05:35:36 PDT 2006

Hi.. I think these are bugs, but I'm not entirely sure:

#void main() {
#  char[] t;
#//  t ~= '我'; // Error: Can only append to dynamic arrays, not char[] 
~= wchar
#  t ~= "我";
#  char[] r;
#  foreach(dchar d; t) {
#    int rel = r.length;
#    r ~= d;
#    if (d>127) assert(r.length-rel>1); // fails
#  }
#  assert(r.length == t.length); // fails

First of all: since I'm allowed to write "r ~= dchar", I should also be 
allowed to do the same with a constant, '\u6211'. This probably got 
posted before.

The second one seems similar: it compiles without complaint, but it's 
not correctly appending the 2-byte dchar to the char[].

These issues seem too common not be known. Should I post them in bugzilla?


More information about the Digitalmars-d-bugs mailing list