[Issue 22473] dmd foreach loops throw exceptions on invalid UTF sequences, use replacementDchar instead

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 4 05:47:07 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22473

Ali Cehreli <acehreli at yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |acehreli at yahoo.com

--- Comment #1 from Ali Cehreli <acehreli at yahoo.com> ---
I think the foreach variable type must be dchar. The following program
reproduces the issue:

void test(char[] a) {
  foreach (dchar c; a) {
  }
}

void main() {
  char[] a = "\xf0\x90\x28\xbc".dup;
  test(a);
}

--


More information about the Digitalmars-d-bugs mailing list