http://d.puremagic.com/issues/show_bug.cgi?id=7476
Kenji Hara <k.hara...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|nob...@puremagic.com |and...@metalanguage.com --- Comment #7 from Kenji Hara <k.hara...@gmail.com> 2012-02-10 04:55:04 PST --- A shallow answer: 2.058 was merged a pull to improve std.format: https://github.com/D-Programming-Language/phobos/pull/298 and after that this regression has been occurred. A deep answer: This is a problem rooted in the std.range.put implementation. reduced code: ---- import std.range; struct LockingTextWriter { void put(dchar c){} } struct RetroResult { bool end = false; @property bool empty() const { return end; } @property dchar front(){ return 'a'; } void popFront(){ end = true; } } void main() { LockingTextWriter w; RetroResult r; put(w, r); // test.d(20) } Output: ---- C:\dmd2\src\phobos\std\range.d(295): Error: static assert "Cannot put a RetroResult into a LockingTextWriter" test.d(20): instantiated from here: put!(LockingTextWriter,RetroResult) Current std.format.formatValue treats retro("abcd") as a kind of string range. And try to put it into Writer by using std.range.put(). void put(R, E)(ref R r, E e) // std.range.put signature When E is an array (of cause it is random access range), put() runs the range-to-range copy. But put() cannot instantiate with E that isn't array range. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------