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


--- Comment #0 from bearophile_hugs eml.cc 2010-02-18 12:52:18 PST ---
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



--- Comment #1 from bearophile_hugs eml.cc 2010-02-18 12:53:26 PST ---
 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



--- Comment #2 from bearophile_hugs eml.cc 2010-06-07 14:45:46 PDT ---
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


--- Comment #3 from nfxjfg gmail.com 2010-06-07 20:18:07 PDT ---
This has the same cause as #3086.
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


--- Comment #4 from nfxjfg gmail.com 2010-06-07 20:20:13 PDT ---
*** 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                   |


--- Comment #5 from Walter Bright <bugzilla digitalmars.com> 2011-04-05
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


--- Comment #6 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-02-01
17:02:44 PST ---
(In reply to comment #5)
 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