Bug 7433 – writeln of char range

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-02-03T15:44:00Z
Last change time
2012-02-18T22:43:55Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-02-03T15:44:45Z
Title: Component: Phobos Severity: Code number: Keywords: Outcome: Is done: no I don't know what's happening here: import std.stdio, std.algorithm; void main() { auto s1 = "hello"; auto m1 = map!(c => c)(s1); writeln(m1); } DMD 2.058head gives: ...\dmd2\src\phobos\std\range.d(295): Error: static assert "Cannot put a Result into a LockingTextWriter" ...\dmd2\src\phobos\std\format.d(1509): instantiated from here: put!(LockingTextWriter,Result) ...\dmd2\src\phobos\std\format.d(1984): instantiated from here: formatRange!(LockingTextWriter,Result,char) ...\dmd2\src\phobos\std\format.d(2228): instantiated from here: formatValue!(LockingTextWriter,Result,char) ...\dmd2\src\phobos\std\format.d(319): ... (2 instantiations, -v to show) ... ...\dmd2\src\phobos\std\stdio.d(1563): instantiated from here: write!(Result,char) test2.d(5): instantiated from here: writeln!(Result) Note that array(m1) works.
Comment #1 by simendsjo — 2012-02-17T10:45:32Z
Comment #2 by k.hara.pg — 2012-02-18T22:43:55Z
*** This issue has been marked as a duplicate of issue 7476 ***