[Issue 14998] New: Cannot put a char into a char[]

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Sep 1 10:34:24 PDT 2015


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

          Issue ID: 14998
           Summary: Cannot put a char into a char[]
           Product: D
           Version: D2
          Hardware: Other
                OS: Other
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: schneider.cedric at gmx.de

Following code does not compile:

int main()
{
     import std.stdio;
     import std.range;
     char[] c;
     c ~= 'a';
     c ~= 'b';
     c.put('c');
     writeln(c);
     return 0;
}

The error is:

C:\dmd\src\phobos\std\range.d(9,9): Error: static assert  "Cannot put a
char into a char[]." (Test)

--


More information about the Digitalmars-d-bugs mailing list