D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7368 - template mixin + __traits(allMembers) = Assertion 'members' failed
Summary: template mixin + __traits(allMembers) = Assertion 'members' failed
Status: RESOLVED DUPLICATE of issue 7160
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-25 11:47 UTC by Tobias Pankrath
Modified: 2012-01-26 05:59 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Tobias Pankrath 2012-01-25 11:47:54 UTC
import std.stdio;

struct A
{
    mixin member!(M1, M2);
}

struct M1 {}
struct M2 {}

mixin template member(children...)
{
    static if(children.length)
    {
        children[0] m;
        mixin member!(children[1..$]);
    }
}

void main()
{
    A a;
    writeln(__traits(allMembers, A));
}

-- 

dmd bugrep.d
dmd: dsymbol.c:1052: static int ScopeDsymbol::foreach(Dsymbols*, int (*)(void*, size_t, Dsymbol*), void*, size_t*): Assertion `members' failed.
Aborted

dmd -v
DMD64 D Compiler v2.057
Copyright (c) 1999-2011 by Digital Mars written by Walter Bright
Documentation: http://www.digitalmars.com/d/2.0/index.html
Comment 1 Kenji Hara 2012-01-26 05:59:44 UTC
Thanks for your reporting, but it was already fixed in git repo.
Please wait the release of 2.058.

*** This issue has been marked as a duplicate of issue 7160 ***