May 02, 2016 how do I prevent null errors when using __traits(derivedMembers | ||||
---|---|---|---|---|
| ||||
Hello, I've been poking around with "__traits", and I came across a problem: whenever I run a code like this "__traits(derivedMembers,members[i]);" I inevitably find a member that has no derived members, and inevitably the compiler tells me that I have an error: "Error: argument has no members", how do I check if a member has derived elements or if it has other elements contained within it? the "members[i]" is an array of members retrieved from "__traits(allMembers, someModule);" I'm trying to map all elements of an unspecified module for auto-completion and suggestion purposes, and I was wondering if there was a simpler/better ways to do that. Thank you. |
Copyright © 1999-2021 by the D Language Foundation