Summary: Functions-as-properties makes it impossible to get the
                    .mangleof a function
           Product: D
           Version: 1.041
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

class A{}
pragma(msg, A.mangleof); // prints "C5dtest1A" as expected

void foo() {}

pragma(msg, foo.mangleof); // prints "v" since typeof(foo) is the same as
pragma(msg, (&foo).mangleof); // prints PFZv, symbol info lost

template T(alias f)
        pragma(msg, f.mangleof); // prints "v"
        const T = "dummy";

pragma(msg, T!(foo));

It'd be really nice to get the mangle of functions.  It'd make it possible to
determine whether a function is static or not, as well as the ref-ness of its
params.  But DMD currently turns any reference to the function into a call to
it as soon as possible, making it impossible to do so.


Reply via email to