Bug 11945 – LockingTextWriter fails with repeat

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-18T10:26:00Z
Last change time
2014-02-15T05:03:14Z
Assigned to
nobody
Creator
tobias

Comments

Comment #0 by tobias — 2014-01-18T10:26:27Z
stdout.lockingTextWriter().put(repeat("#", 12)); /usr/include/dlang/dmd/std/stdio.d(1546): Error: no property 'ptr' for type 'Take!(Repeat!char)' test.d(6): Error: template instance std.stdio.File.LockingTextWriter.put!(Take!(Repeat!char)) error instantiating
Comment #1 by peter.alexander.au — 2014-01-27T13:09:09Z
I get a different error for that. Are you sure the error doesn't correspond to this call? stdout.lockingTextWriter().put(repeat('#', 12)); (Note '#' vs "#")
Comment #2 by github-bugzilla — 2014-02-15T04:47:57Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5dbb6539e3bce241ccea886ebef9ad1f4e201020 Fix Issue 11945 - LockingTextWriter.put The function just had sloppy constraints while assuming it was a string. This fixes it up and adds some basic unit tests. https://d.puremagic.com/issues/show_bug.cgi?id=11945 https://github.com/D-Programming-Language/phobos/commit/2b558a95f21cfd6a3b6db7d45916a11a8a828798 Merge pull request #1887 from Poita/bug11945 Fix Issue 11945 - LockingTextWriter.put