← Back to index
|
Original Bugzilla link
Bug 20487 – Formatter does not support nothrow sink delegate
Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-01-08T07:33:18Z
Last change time
2024-12-01T16:36:12Z
Assigned to
No Owner
Creator
Andrej Mitrovic
Moved to GitHub: phobos#10403 →
Comments
Comment #0
by andrej.mitrovich — 2020-01-08T07:33:18Z
----- module test; import std.stdio; struct S { public void toString (scope void delegate(scope const(char)[]) @safe nothrow sink) @safe { sink("output"); } } void main() { S s; writeln(s); } ----- $ dmd test.d ----- /Library/D/dmd/src/phobos/std/format.d(3962): Error: function `test.S.toString(scope void delegate(scope const(char)[]) nothrow @safe sink)` is not callable using argument types `(void delegate(scope const(char)[] s) @safe)` /Library/D/dmd/src/phobos/std/format.d(3962): cannot pass argument `__lambda4` of type `void delegate(scope const(char)[] s) @safe` to parameter `scope void delegate(scope const(char)[]) nothrow @safe sink` /Library/D/dmd/src/phobos/std/format.d(4342): Error: template instance `std.format.formatObject!(LockingTextWriter, S, char)` error instantiating /Library/D/dmd/src/phobos/std/format.d(1854): instantiated from here: `formatValueImpl!(LockingTextWriter, S, char)` /Library/D/dmd/src/phobos/std/format.d(575): instantiated from here: `formatValue!(LockingTextWriter, S, char)` /Library/D/dmd/src/phobos/std/stdio.d(1506): instantiated from here: `formattedWrite!(LockingTextWriter, char, S)` /Library/D/dmd/src/phobos/std/stdio.d(3863): instantiated from here: `write!(S, char)` test.d(14): instantiated from here: `writeln!(S)` Failed: ["/Library/D/dmd/bin/dmd", "-g", "-unittest", "-v", "-o-", "test.d", "-I."] [Finished in 0.7s] -----
Comment #1
by robert.schadek — 2024-12-01T16:36:12Z
THIS ISSUE HAS BEEN MOVED TO GITHUB
https://github.com/dlang/phobos/issues/10403
DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB