[Issue 14752] New: Implicit conversion fail for array concatenation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jun 30 12:23:44 PDT 2015


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 at puremagic.com
          Reporter: bugzilla at 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.

--


More information about the Digitalmars-d-bugs mailing list