www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16602] New: Implicit string concatenation and precedence of ~


          Issue ID: 16602
           Summary: Implicit string concatenation and precedence of ~
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andrej.mitrovich gmail.com

In the upcoming version of DMD implicit concatenation of strings is deprecated.

However, simply adding ~ may not lead to the same semantics as before. Observe:

import std.stdio;
import std.string;

void main ( )
    string a = "some %s format "

    writeln(a);  // ok

    string b = "some %s format " ~
               "string".format("nice");  // exception thrown


In the second example format() is called before the two strings are

Oct 07 2016