https://issues.dlang.org/show_bug.cgi?id=12798
Issue ID: 12798
Summary: constant folding should optimize subsequent
concatenations
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: performance
Severity: major
Priority: P1
Component: DMD
Assignee: [email protected]
Reporter: [email protected]
This is front-end optimizer issue.
Preceding concatenations of string literals will be optimized to one long
literal.
string x;
string y = "a" ~ "b" ~ x; // optimized to "ab" ~ x
But subsequent one doesn't.
string z = x ~ "a" ~ "b"; // not optimized to x ~ "ab"
--