D2 has a getMembers method in TypeInfo and ClassInfo that would probably do the job. Only problem is that the compiler doesn't actually generate the function for it. I asked about it a while ago, but never got a response.