[Issue 1373] typeof(func).stringof fails when func has parameters.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 26 06:20:11 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=1373


Harry Vennik <htvennik at zonnet.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |htvennik at zonnet.nl


--- Comment #4 from Harry Vennik <htvennik at zonnet.nl> 2010-04-26 06:20:08 PDT ---
This issue bugged me with DMD 2.043 on Mac.

I noticed something peculiar which is demonstrated by this test case:

-----
void foo(int i) { }
enum string FOO_TYPE = typeof(foo).stringof;
pragma(msg, "Type of foo is: " ~ FOO_TYPE);
-----

Compiling that will print:

-----
stringof_error.d(2): Error: expected 1 function arguments, not 0
Type of foo is: (void(int i))()
-----

So actually, the .stringof is correctly evaluated, but still some unnecessary
check for function arguments makes the compiler generate an error.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list