Thread overview
[Issue 2234] New: __traits(allMembers) returns incorrect results for mixin and template alias members of an aggregate
Jul 18, 2008
d-bugmail
Aug 13, 2010
Justin Whear
Jul 14, 2011
Kenji Hara
Aug 13, 2011
Walter Bright
July 18, 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2234

           Summary: __traits(allMembers) returns incorrect results for mixin
                    and template alias members of an aggregate
           Product: D
           Version: 2.017
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code, spec
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: samukha@voliacable.com


1. Unnamed mixin
----
import std.stdio;

template Foo()
{
  int x;
}

struct S
{
  mixin Foo;
}

void main()
{
  writefln(__traits(allMembers, S));
}
----
Outputs [__T3FooZ] instead of the expected [x]

2. Multiple unnamed mixins
---
template Foo()
{
  int x;
}

struct S
{
  mixin Foo;
  mixin Foo;
}

void main()
{
  writefln(__traits(allMembers, S));
}
----
Outputs [__T3FooZ]. What's the expected output anyway? Could the name conflict be detected before the conflicted name is referenced?


3. Template alias
----
import std.stdio;

template Foo()
{
  int x;
}

struct S
{
  alias Foo!() foo;
}

void main()
{
  writefln(__traits(allMembers, S));
}
----
Outputs [foo __T3FooZ] instead of the expected [foo]


-- 

August 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=2234


Justin Whear <mrjnewt@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mrjnewt@hotmail.com
            Version|2.017                       |2.041
         OS/Version|Windows                     |All


--- Comment #1 from Justin Whear <mrjnewt@hotmail.com> 2010-08-13 16:06:24 PDT ---
Updating as this is still broken in 2.048

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 14, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2234


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |k.hara.pg@gmail.com


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-07-14 04:35:40 PDT ---
https://github.com/D-Programming-Language/dmd/pull/231

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 13, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2234


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2011-08-12 22:38:18 PDT ---
https://github.com/D-Programming-Language/dmd/commit/ddfeba9ced58881a343d8392a42f6910339c441c

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------