Normally FuncDeclaration and FuncAliasDeclaration have overloads. If and only if there is no overloads, mangle() could return exact mangled name.
module test; void foo(long) {} // _D4test3fooFlZv void foo(string) {} // _D4test3fooFAyaZv
// from FuncDeclaration.mangle(). pragma(msg, foo.mangleof); // prints unexact mangled name "4test3foo" // by calling Dsymbol.mangle()
// from FuncAliasDeclaration.mangle() pragma(msg, __traits(getOverloads, test, "foo")[0].mangleof); // "_D4test3fooFlZv" pragma(msg, __traits(getOverloads, test, "foo")[1].mangleof); // "_D4test3fooFAyaZv"
If a function has no overloads, .mangleof property still returns exact mangled name.
void bar() {} pragma(msg, bar.mangleof); // still prints "_D4test3barFZv" // by calling FuncDeclaration.mangleExact().
See Implementation
Normally FuncDeclaration and FuncAliasDeclaration have overloads. If and only if there is no overloads, mangle() could return exact mangled name.
module test; void foo(long) {} // _D4test3fooFlZv void foo(string) {} // _D4test3fooFAyaZv
// from FuncDeclaration.mangle(). pragma(msg, foo.mangleof); // prints unexact mangled name "4test3foo" // by calling Dsymbol.mangle()
// from FuncAliasDeclaration.mangle() pragma(msg, __traits(getOverloads, test, "foo")[0].mangleof); // "_D4test3fooFlZv" pragma(msg, __traits(getOverloads, test, "foo")[1].mangleof); // "_D4test3fooFAyaZv"
If a function has no overloads, .mangleof property still returns exact mangled name.
void bar() {} pragma(msg, bar.mangleof); // still prints "_D4test3barFZv" // by calling FuncDeclaration.mangleExact().