www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17358] New: [REG 2.074.0]

https://issues.dlang.org/show_bug.cgi?id=17358

          Issue ID: 17358
           Summary: [REG 2.074.0] std.stdio.File.lockingTextWriter.put no
                    longer accepts chains of characters
           Product: D
           Version: D2
          Hardware: x86
                OS: Mac OS X
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: jack jackstouffer.com

This compiled in 2.073.2 and doesn't anymore

void main()
{
    import std.stdio;
    import std.range;
    import std.conv;

    auto f = File("test", "w");
    auto s = 42.toChars;
    f.lockingTextWriter.put(chain(s, "\n"));
}

test2.d(12): Error: template std.stdio.File.LockingTextWriter.put cannot deduce
function from argument types !()(Result), candidates are:
/usr/local/Cellar/dmd/2.074.0/include/dlang/dmd/std/stdio.d(2742):       
std.stdio.File.LockingTextWriter.put(A)(A writeme) if
((isSomeChar!(Unqual!(ElementType!A)) || is(ElementType!A : const(ubyte))) &&
isInputRange!A && !isInfinite!A)
/usr/local/Cellar/dmd/2.074.0/include/dlang/dmd/std/stdio.d(2773):       
std.stdio.File.LockingTextWriter.put(C)(C c) if (isSomeChar!C || is(C :
const(ubyte)))

To be honest, I have no idea what is going on here, because the sig constraint

    pragma(msg, (isSomeChar!(Unqual!(ElementType!A)) || is(ElementType!A :
const(ubyte))) && isInputRange!A && !isInfinite!A);

prints "true".

--
Apr 28 2017