[Issue 22782] New: [dip1000] string escaped by throwing constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 16 19:45:33 UTC 2022


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

          Issue ID: 22782
           Summary: [dip1000] string escaped by throwing constructor
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: Ajieskola at gmail.com

------
struct DontDoThis
{ immutable char[12] content;
  @safe this(char ch)
  { content[] = ch;
    throw new Exception(content[]);
  }
}

void main() @safe
{ import std.stdio;
  DontDoThis('a');
}
------

Prints a garbage error message. Compiled with -preview=dip1000, using latest
master.

--


More information about the Digitalmars-d-bugs mailing list