www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3831] New: writeln of a delegate typeid

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831

           Summary: writeln of a delegate typeid
           Product: D
           Version: 2.040
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



import std.stdio: writeln;
void main() {
    double sqr(double x) { return x * x; }
    writeln(typeid(typeof(&sqr)));
    pure double psqr(double x) { return x * x; }
    writeln(typeid(typeof(&psqr)));
}

It prints:
double delegate()
double delegate()

Instead of:
double delegate(double x)
pure double delegate(double x)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 18 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831




 Instead of:
 double delegate(double x)
 pure double delegate(double x)
Sorry, I meant: Instead of: double delegate(double) pure double delegate(double) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 18 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831




Another example, with functions too:

import std.stdio: writeln;

int foo(float x) { return 0; }

void main() {
    writeln(typeid(typeof(foo))); // int()

    int bar(float x) { return 0; }
    writeln(typeid(typeof(bar))); // int()

    int delegate(float) baz = (float x) { return 0; };
    writeln(typeid(typeof(baz))); // int delegate()
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 07 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831


nfxjfg gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nfxjfg gmail.com




If you don't think it deserves to be marked as duplicate, undo it.
(But I think it's a good idea to keep bug reports caused by the same thing at
minimum.)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 07 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831


nfxjfg gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



*** This issue has been marked as a duplicate of issue 3086 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 07 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |bugzilla digitalmars.com
         Resolution|DUPLICATE                   |



20:39:25 PDT ---
3086 doesn't fix it. It could be fixed by having toString() demangle the deco.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 05 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3831


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



17:02:44 PST ---

 3086 doesn't fix it. It could be fixed by having toString() demangle the deco.
Well it returns 'FfZi' for this function: int foo(float x) { return 0; } But std.demangle doesn't decode it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Feb 01 2013