← Back to index
|
Original Bugzilla link
Bug 13746 – formatValue of delegates with @nogc
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-18T09:13:00Z
Last change time
2015-02-18T03:39:57Z
Assigned to
nobody
Creator
ilyayaroshenko
Comments
Comment #0
by ilyayaroshenko — 2014-11-18T09:13:41Z
unittest { static void func() {} formatTest( &func, "void function()" ); } unittest { void func() @nogc {} formatTest( &func, "@nogc void delegate()" ); } void formatTest(T)(T val, string expected, size_t ln = __LINE__, string fn = __FILE__) { import std.array : appender; import std.conv : text; FormatSpec!char f; auto w = appender!string(); formatValue(w, val, f); enforce!AssertError( w.data == expected, text("expected = `", expected, "`, result = `", w.data, "`"), fn, ln); }
Comment #1
by ilyayaroshenko — 2014-11-18T10:55:44Z
update: unittest { import std.conv : to; int i; int foo(short k) @nogc { return i + k; } int delegate(short) @nogc bar() nothrow { return &foo; } assert(to!string(&bar) == "int delegate(short) @nogc delegate() nothrow"); }
Comment #2
by github-bugzilla — 2014-11-19T18:00:25Z
Commits pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/04c16e49c0d6a7f9a56be05623be775c56614083
fix Issue 13746 - formatValue of delegates
https://github.com/D-Programming-Language/phobos/commit/33f089cbd9ad16c77d20400634ac09521da6fce3
Merge pull request #2745 from 9il/fv fix Issue 13746 - formatValue of delegates
Comment #3
by github-bugzilla — 2015-02-18T03:39:57Z
Commits pushed to 2.067 at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/04c16e49c0d6a7f9a56be05623be775c56614083
fix Issue 13746 - formatValue of delegates
https://github.com/D-Programming-Language/phobos/commit/33f089cbd9ad16c77d20400634ac09521da6fce3
Merge pull request #2745 from 9il/fv