Kenji Hara <> changed:

           What    |Removed                     |Added
         AssignedTo|        |

--- Comment #7 from Kenji Hara <> 2012-02-10 04:55:04 PST ---
A shallow answer:
2.058 was merged a pull to improve std.format:
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)

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

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to