[Issue 2551] std.format on invariant values : error and segmentation fault
https://issues.dlang.org/show_bug.cgi?id=2551 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Version|2.022 |D2 --
[Issue 2551] std.format on invariant values : error and segmentation fault
http://d.puremagic.com/issues/show_bug.cgi?id=2551 Don clugd...@yahoo.com.au changed: What|Removed |Added Status|NEW |RESOLVED CC||clugd...@yahoo.com.au Resolution||FIXED --- Comment #3 from Don clugd...@yahoo.com.au 2009-10-19 01:19:49 PDT --- This was fixed between 2.026 and 2.030. I believe the segfault was fixed in 2.027. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2551] std.format on invariant values : error and segmentation fault
http://d.puremagic.com/issues/show_bug.cgi?id=2551 --- Comment #1 from dsim...@yahoo.com 2009-03-27 11:48 --- The problem is the following code: } else static if (is(const D == const(float)) || is(const(D) == const(double)) || is(const(D) == const(real))) { // Do stuff. } else // Similar stuff for more types. The problem is that const(immutable(T)) seems to evaluate to immutable(T), not const(T), as the following program demonstrates: import std.stdio; void main() { immutable real foo = 1.0L; alias const(typeof(foo)) T; writeln(T.stringof); // Prints immutable(real). } This can probably be fixed by changing is(const(T) == const someType) tests to is(immutable(T) == immutable someType). --
[Issue 2551] std.format on invariant values : error and segmentation fault
http://d.puremagic.com/issues/show_bug.cgi?id=2551 --- Comment #2 from dsim...@yahoo.com 2009-03-27 14:28 --- Created an attachment (id=294) -- (http://d.puremagic.com/issues/attachment.cgi?id=294action=view) Patch for std.format problems. Here's a patch that does what I suggested previously. It seems to solve the problem, and all of the std.format unittests still pass, except for the ones on lines 2462 and 2464, which don't pass even without the patch. --