D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2069 - Invalid return type for __traits(derivedMembers, ...) if there are no derived members
Summary: Invalid return type for __traits(derivedMembers, ...) if there are no derived...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2008-05-05 12:54 UTC by Max Samukha
Modified: 2015-06-09 01:19 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Max Samukha 2008-05-05 12:54:42 UTC
If the type passed to __traits(derivedMembers, ...) does not have any derived members, an array of void[0u] type is returned instead of invariant(char)[][0u]; 

class C
{
    //int x; // uncomment to make it compile
}

static assert (is (typeof(__traits(derivedMembers, C)) : string[]));
Comment 1 Trass3r 2010-02-04 19:47:19 UTC
This was "fixed" in r360 since derivedMembers now returns a tuple instead of an array literal.