I just noticed that ClassInfo.find doesn't work for nested classes, even if they are static. For example: unittest { static class Foo { } auto name = Foo.classinfo.name; assert(ClassInfo.find(name) is null); // unfortunately passes } I was about to try the documented unit test feature in my work on std.serialization but I want to have the type I'm serializing visible in the example as well. Is it possible to fix somehow? I looked at the symbol table and it seems the class info is there, but ClassInfo.find just can't find it. 0000000100040980 D _D4test14__unittestL7_1FZv3Foo6__initZ 0000000100040a50 D _D4test14__unittestL7_1FZv3Foo6__vtblZ 00000001000409b0 D _D4test14__unittestL7_1FZv3Foo7__ClassZ
This is almost certainly a druntime bug
I'm pretty sure that class infos for nested classes are never added by the compiler in the first place, see this: https://github.com/D-Programming-Language/dmd/blob/master/src/toobj.c#L68-L73 The compiler needs to iterate all types that can have nested classes, not just the members of the module, as it does now. I tried to fix this myself but I haven't been able to figure out how to iterate all nested types of a function. I'm setting this back to an issue with the compiler.
I would say that "addLocalClass" should be implemented by all Dsymbols that have members.
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18654 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB