Bug 8481 – assert can't concatenate strings

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-31T04:04:00Z
Last change time
2012-07-31T17:43:30Z
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2012-07-31T04:04:57Z
Copied from Forum: ---- import std.conv; void main() { static assert( is(typeof(("Failure: " ~ to!string(55)) == string)) ); static assert(0 , ("Failure: " ~ to!string(55))); } ---- main.d(7): Error: static assert ['F','a','i','l','u','r','e',':',' ','5','5'] ---- The problem is the ugly-ass "print as array of individual characters". Changing the code to ---- import std.conv; void main() { static assert( is(typeof(("Failure: " ~ to!string(55)) == string)) ); static assert(0 , text("Failure: ", to!string(55))); or static assert(0 , format("Failure: %s", to!string(55))); } ---- Works as intended.
Comment #1 by ellery-newcomer — 2012-07-31T17:43:30Z
*** This issue has been marked as a duplicate of issue 7998 ***