← Back to index
|
Original Bugzilla link
Bug 8310 – writeln of Range of fixed size array
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-27T05:21:00Z
Last change time
2012-06-28T00:34:49Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0
by bearophile_hugs — 2012-06-27T05:21:17Z
import std.stdio: writeln; import std.algorithm: map; import std.array: array; void main() { char[2] two = ['a', 'b']; auto pieces = [1, 2].map!(x => two)(); writeln(pieces.array()); } It gives an acceptable output (dmd 2.060alpha): ["ab", "ab"] But printing the lazy range itself fails: import std.stdio: writeln; import std.algorithm: map; void main() { char[2] two = ['a', 'b']; auto pieces = [1, 2].map!(x => two)(); writeln(pieces); } ...\dmd2\src\phobos\std\format.d(1978): Error: template std.format.formatValue does not match any function template declaration ...\dmd2\src\phobos\std\format.d(1203): Error: template std.format.formatValue cannot deduce template function from argument types !()(LockingTextWriter,char[2u],FormatSpec!(char)) ...\dmd2\src\phobos\std\format.d(2006): Error: template std.format.formatValue does not match any function template declaration ...\dmd2\src\phobos\std\format.d(1203): Error: template std.format.formatValue cannot deduce template function from argument types !()(LockingTextWriter,char[2u],FormatSpec!(char)) ...\dmd2\src\phobos\std\format.d(2474): Error: template instance std.format.formatRange!(LockingTextWriter,Result,char) error instantiating ...\dmd2\src\phobos\std\format.d(2761): instantiated from here: formatValue!(LockingTextWriter,Result,char) ...\dmd2\src\phobos\std\format.d(420): instantiated from here: formatGeneric!(LockingTextWriter,Result,char) ...\dmd2\src\phobos\std\stdio.d(683): instantiated from here: formattedWrite!(LockingTextWriter,char,Result) ...\dmd2\src\phobos\std\stdio.d(1594): instantiated from here: write!(Result,char) test.d(6): instantiated from here: writeln!(Result) ...\dmd2\src\phobos\std\format.d(2761): Error: template instance std.format.formatValue!(LockingTextWriter,Result,char) error instantiating ...\dmd2\src\phobos\std\format.d(420): instantiated from here: formatGeneric!(LockingTextWriter,Result,char) ...\dmd2\src\phobos\std\stdio.d(683): instantiated from here: formattedWrite!(LockingTextWriter,char,Result) ...\dmd2\src\phobos\std\stdio.d(1594): instantiated from here: write!(Result,char) test.d(6): instantiated from here: writeln!(Result) ...\dmd2\src\phobos\std\format.d(420): Error: template instance std.format.formatGeneric!(LockingTextWriter,Result,char) error instantiating ...\dmd2\src\phobos\std\stdio.d(683): instantiated from here: formattedWrite!(LockingTextWriter,char,Result) ...\dmd2\src\phobos\std\stdio.d(1594): instantiated from here: write!(Result,char) test.d(6): instantiated from here: writeln!(Result) ...\dmd2\src\phobos\std\stdio.d(683): Error: template instance std.format.formattedWrite!(LockingTextWriter,char,Result) error instantiating ...\dmd2\src\phobos\std\stdio.d(1594): instantiated from here: write!(Result,char) test.d(6): instantiated from here: writeln!(Result) ...\dmd2\src\phobos\std\stdio.d(1594): Error: template instance std.stdio.File.write!(Result,char) error instantiating test.d(6): instantiated from here: writeln!(Result) test.d(6): Error: template instance std.stdio.writeln!(Result) error instantiating
Comment #1
by k.hara.pg — 2012-06-27T21:19:05Z
https://github.com/D-Programming-Language/phobos/pull/652
Comment #2
by github-bugzilla — 2012-06-28T00:00:28Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/6c781f1ecf59a332ce842f7369aa3247a43956a0
fix Issue 8310 - writeln of Range of fixed size array
https://github.com/D-Programming-Language/phobos/commit/886c384ba90016cb5b8e7491743d3e88bfa8f481
Merge pull request #652 from 9rnsr/fix8310 Issue 8310 - writeln of Range of fixed size array