Bug 7531 – writeln doesn't work an a range that uses some char as front

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-17T07:04:00Z
Last change time
2012-02-17T07:13:24Z
Assigned to
nobody
Creator
simendsjo

Comments

Comment #0 by simendsjo — 2012-02-17T07:04:04Z
import std.stdio; struct S { void popFront() { } char front() { return 'a'; } @property bool empty() { return false; } } void main() { writeln(S()); } range.d(295): Error: static assert "Cannot put a S into a LockingTextWriter" format.d(1509): instantiated from here: put!(LockingTextWriter,S) format.d(1984): instantiated from here: formatRange!(LockingTextWriter,S,char) format.d(2228): instantiated from here: formatValue!(LockingTextWriter,S,char) format.d(319): instantiated from here: formatGeneric!(LockingTextWriter,S,char) stdio.d(684): instantiated from here: formattedWrite!(LockingTextWriter,char,S) stdio.d(1563): instantiated from here: write!(S,char)
Comment #1 by simendsjo — 2012-02-17T07:05:52Z
Using 2.058
Comment #2 by k.hara.pg — 2012-02-17T07:13:24Z
This is a dup of bug 7476. Read comment#7 in it. *** This issue has been marked as a duplicate of issue 7476 ***