Thread overview
[Issue 19708] Can't use __traits(getAttributes, ...)[...] as a type
Jul 05
Basile-z
Jul 05
Basile-z
Jul 05
Basile-z
Jul 06
Basile-z
Jul 06
Dlang Bot
Jul 06
Dlang Bot
Jul 06
Dlang Bot
July 05
https://issues.dlang.org/show_bug.cgi?id=19708

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |b2.temp@gmx.com
         Resolution|---                         |FIXED

--- Comment #1 from Basile-z <b2.temp@gmx.com> ---
It was a dup of 7804, which is implemented now.

--
July 05
https://issues.dlang.org/show_bug.cgi?id=19708

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Hardware|x86_64                      |All
         Resolution|FIXED                       |---
                 OS|Windows                     |All

--- Comment #2 from Basile-z <b2.temp@gmx.com> ---
sorry i missed that most failing code is commented. There's indeed a problem with direct __trait aliasing. Tuples processing (as obtained by __trait(getAttributes) is incomplete.

--
July 05
https://issues.dlang.org/show_bug.cgi?id=19708

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid

--
July 06
https://issues.dlang.org/show_bug.cgi?id=19708

--- Comment #3 from Basile-z <b2.temp@gmx.com> ---
Most of the fix is easy but the part involving an index is more complicated because there's a kind of precedence problem:

  alias d = __traits(getAttributes, bar)[0];

is more like (using parens to explain even if not valid)

  alias d = IndexedBy(__traits(getAttributes, bar), 0);

The internal wrapper is itself wrapped in the type that stores the index so a flag indicating if symbols are allowed when processing the trait is never set. That's why there's the spurious error message about giving a type.

--
July 06
https://issues.dlang.org/show_bug.cgi?id=19708

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Basile-z created dlang/dmd pull request #10143 "fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type" fixing this issue:

- fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type

https://github.com/dlang/dmd/pull/10143

--
July 06
https://issues.dlang.org/show_bug.cgi?id=19708

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Basile-z created dlang/dmd pull request #10144 "fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type" fixing this issue:

- fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type

https://github.com/dlang/dmd/pull/10144

--
July 06
https://issues.dlang.org/show_bug.cgi?id=19708

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #10144 "fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type" was merged into stable:

- caf888bd949a119c2136be6ee7011eedbf3f5f0b by Basile Burg:
  fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type

https://github.com/dlang/dmd/pull/10144

--