[Issue 7804] Cannot alias __traits directly

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 13 13:47:06 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=7804

Basile B. <b2.temp at gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp at gmx.com

--- Comment #9 from Basile B. <b2.temp at gmx.com> ---
I've managed to get it working for types. It has to because the grammar has to
changed so that __trait(getMember,...) becomes a BasicType.
To be clear my hacked DMD for

  struct Foo{struct A{}}
  alias FooA = __traits(getMember, Foo, "A");
  pragma(msg, FooA.stringof);

says: "A". Or even

  struct Foo{alias MyInt = int;}
  alias FooInt = __traits(getMember, Foo, "MyInt");
  static immutable FooInt fi = 42;
  pragma(msg, fi);

says "42"

Next step is for variables and other symbols.
WIP here: https://github.com/BBasile/dmd/pull/1/files

--


More information about the Digitalmars-d-bugs mailing list