Bug 12352 – Consistently stop encoding return type of parent functions
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-12T07:39:00Z
Last change time
2014-03-28T20:39:21Z
Keywords
pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2014-03-12T07:39:44Z
Currently, for a function local symbol, the return types of its parent functions are normally mangled into the name.
module test;
int foo()
{
void bar() {
struct S {}
pragma(msg, S.mangleof);
// S 4test 3fooFZi 3barMFZv 1S
// | |
// int of foo |
// void of bar
}
return 0;
}
But, for Voldemort types, we already has an exception of the rule.
module test;
auto foo()
{
auto bar() {
struct S {}
pragma(msg, S.mangleof);
// S 4test 3fooFZ 3barMFZ 1S
// | |
// no return type for foo |
// no return type for bar
return S();
}
return 0;
}
The change was introduced to fix Issue 8847.
Essentially encoding the return types is redundant, because D does not allow function overloading based on the return types.