[Issue 17379] Mangle voldemort types as if they are defined in the outer scope to avoid exponential symbol name length with templates

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun May 7 10:34:18 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17379

--- Comment #3 from Georgi D <georgid at outlook.com> ---
(In reply to Rainer Schuetze from comment #2)
> Is this meant as a special rule "if the symbol has only a single identifier,
> prepend the function name and signature"? This could work but only helps for
> some cases. 
> 

I am not sure what you mean by prepend the function name. The suggestion does
not prepend the function name. Could you elaborate?

> Otherwise it easily gets ambiguous and I'd rather see a special token for
> "unspecified return type" that could be demangled as "auto".
> 
> See https://github.com/dlang/dmd/pull/5855 for a more generic approach.

This is not meant as a special case rule. It is a generic lowering of voldemort
types in function templates to be as if defined outside of the function so they
do not grow exponentially in size. It does not have a limit on the number of
template arguments. It is also not ambiguous since the transformation is
equivalent to explicitly writing out the template.

I am aware of https://github.com/dlang/dmd/pull/5855 and think it is a great
idea but it is a compression of the symbol so if the original symbol is shorter
then the compressed symbol is also going to be shorter. This suggestion tackles
the problem of how the original symbol can be shorter.

--


More information about the Digitalmars-d-bugs mailing list