[Issue 13746] New: formatValue of functions and delegates with UDA or @nogc
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Nov 18 01:13:41 PST 2014
https://issues.dlang.org/show_bug.cgi?id=13746
Issue ID: 13746
Summary: formatValue of functions and delegates with UDA or
@nogc
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: ilyayaroshenko at gmail.com
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);
}
--
More information about the Digitalmars-d-bugs
mailing list