www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17546] New: Cannot call .stringof on a function symbol if it

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

          Issue ID: 17546
           Summary: Cannot call .stringof on a function symbol if it does
                    not have a no-args overload
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: monkeyworks12 hotmail.com

int test()
{
    return 0;
}

void main()
{
    pragma(msg, test.stringof);
}

It seems that the only way to make this work is add a no-args overload of
`test`. It still seems that something weird is going on if I do that, however:

int test()
{
    return 0;
}

void main()
{
        //Prints "test()"
    pragma(msg, test.stringof);
}

Currently I am resorting to a hacky workaround by doing
`(&test).stringof[2..$]`.

--
Jun 24 2017