www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14752] New: Implicit conversion fail for array concatenation

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

          Issue ID: 14752
           Summary: Implicit conversion fail for array concatenation
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

Consider:

  void main() {
    char[] x;
    string s = "abc" ~ x;
  }

which fails to compile with:

  Error: cannot implicitly convert expression ("abc" ~ x) of type char[] to
string

This should work, because the ~ operator produces a unique allocated string.

--
Jun 30 2015