[Issue 5986] New: Function pointers wrongly typed

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 12 02:40:26 PDT 2011


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

           Summary: Function pointers wrongly typed
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: raphael.londeix at gmail.com


--- Comment #0 from Raphael Londeix <raphael.londeix at gmail.com> 2011-05-12 02:36:22 PDT ---
Created an attachment (id=967)
full example to reproduce

Hi,

When using auto, the wrong type is infered from the expression &Class.method. I
have to fully specify the type. However, even when I do that, the typeid does
not include any information of the argument type (which is Class).

Class a;

auto f = &Class.method; // void()*
f(); // Segfault, imho it's normal
f(a); // compile error


void function(Class) f2 = &Class.method; // Still void()* !
f2(a); // fine :)

See snippet for full example :)

-- 
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