www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18538] New: ubyte[] can append to string

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

          Issue ID: 18538
           Summary: ubyte[] can append to string
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

Repro:

    string s;
    ubyte[] ub;
    s ~= ub;

Expected:

    For that to not work.

Actual:

    It work.

Notes:

    https://dlang.org/spec/type.html
    ubyte: 8 bits
    char: UTF-8 code unit

    Many 8-bit numbers are not valid UTF-8 code points.

--
Feb 28 2018