D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7433 - writeln of char range
Summary: writeln of char range
Status: RESOLVED DUPLICATE of issue 7476
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-02-03 15:44 UTC by bearophile_hugs
Modified: 2012-02-18 22:43 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2012-02-03 15:44:45 UTC
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 simendsjo 2012-02-17 10:45:32 UTC
Perhaps http://d.puremagic.com/issues/show_bug.cgi?id=7476
Comment 2 Kenji Hara 2012-02-18 22:43:55 UTC

*** This issue has been marked as a duplicate of issue 7476 ***