www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2234] New: __traits(allMembers) returns incorrect results for mixin and template alias members of an aggregate

reply d-bugmail puremagic.com writes:
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]


-- 
Jul 18 2008
parent d-bugmail puremagic.com writes:
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: -------
Aug 13 2010