digitalmars.D.bugs - [Issue 16602] New: Implicit string concatenation and precedence of ~
- via Digitalmars-d-bugs (31/31) Oct 07 2016 https://issues.dlang.org/show_bug.cgi?id=16602
https://issues.dlang.org/show_bug.cgi?id=16602 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 " "string".format("nice"); writeln(a); // ok string b = "some %s format " ~ "string".format("nice"); // exception thrown writeln(b); } ----- In the second example format() is called before the two strings are concatenated. --
Oct 07 2016