_D13libd_demangle12__ModuleInfoZ
_D15TypeInfo_Struct6__vtblZ
_D3std5stdio12__ModuleInfoZ
_D3std6traits15__T8DemangleTkZ8Demangle6__initZ
_D47TypeInfo_S3std6traits15__T8DemangleTkZ8Demangle6__initZ
demangle is currently designed to demangle functions names,
while the strings above are types. During parsing, demangle
sees the string as a qualified name and then expects a type,
and when it doesn't find one it figures the symbol isn't valid.
It sounds like we either need a separate function for
demangling types or if the demangle function encounters a 'Z'
when it expects a type name it should realize it's demangling a
type name, back up, and try again according to that logic. I
suggest submitting a ticket.
To learn how the demangler works, the easiest thing is to copy
core.demangle into your workspace and compile a small app with
it directly, turning on the debug info. For example:
module abc;
import demangle_;
import std.stdio;
void main() {
writeln(decodeDmdString("_D47TypeInfo_S3std6traits15__T8DemangleTkZ8Demangle6__initZ"));
}
$ dmd abc -debug=trace -debug=info demangle
Thanks, I'll do that. (Odd, my original post vanished from the
thread.)