Thread overview
[Issue 23966] [REG2.102] Cannot use traits(getAttributes) with overloaded template
Jun 13
RazvanN
Jun 13
RazvanN
Jun 27
Dlang Bot
Jul 04
Dlang Bot
Jul 15
Dlang Bot
June 04
https://issues.dlang.org/show_bug.cgi?id=23966

johanengelen@weka.io changed:

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

--
June 08
https://issues.dlang.org/show_bug.cgi?id=23966

Adam D. Ruppe <destructionator@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator@gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator@gmail.com> ---
this also affected me in the jsvar.d internals. i worked around by calling getOverloads again inside the getOverloads loop.

foreach(idx, _ignored; __traits(getOverloads))
  __traits(getAttributes, __traits(getOverloads)[idx])

that kind of thing.

--
June 13
https://issues.dlang.org/show_bug.cgi?id=23966

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |razvan.nitu1305@gmail.com

--- Comment #2 from RazvanN <razvan.nitu1305@gmail.com> ---
This is not a problem with the deprecation of __traits(getAttributes), but
rather a problem of traits(getOverloads). This was simply exposed by the
deprecation. If you use __traits(getLocation) instead of getAttributes, you
will get the same behavior (except that an error is issued, not a deprecation):

  module test;

  @("gigi")
  void fun() {}
  @("mimi")
  void fun(int) {}
  @("didi")
  void fun()(int, ulong) {}

  void main()
  {
      //pragma(msg, __traits(getAttributes, fun));
      pragma(msg, __traits(getOverloads, test, "fun"));
      static foreach (t; __traits(getOverloads, test, "fun"))
          pragma(msg, __traits(getLocation, t));
  }

--
June 13
https://issues.dlang.org/show_bug.cgi?id=23966

--- Comment #3 from RazvanN <razvan.nitu1305@gmail.com> ---
(In reply to RazvanN from comment #2)
> This is not a problem with the deprecation of __traits(getAttributes), but
> rather a problem of traits(getOverloads). This was simply exposed by the
> deprecation. If you use __traits(getLocation) instead of getAttributes, you
> will get the same behavior (except that an error is issued, not a
> deprecation):
> 
>   module test;
> 
>   @("gigi")
>   void fun() {}
>   @("mimi")
>   void fun(int) {}
>   @("didi")
>   void fun()(int, ulong) {}
> 
>   void main()
>   {
>       //pragma(msg, __traits(getAttributes, fun));
>       pragma(msg, __traits(getOverloads, test, "fun"));
>       static foreach (t; __traits(getOverloads, test, "fun"))
>           pragma(msg, __traits(getLocation, t));
> 
>   }

Updated snippet, without comments and extra things:

  module test;

  @("gigi")
  void fun() {}
  @("mimi")
  void fun(int) {}
  @("didi")
  void fun()(int, ulong) {}

  void main()
  {
      static foreach (t; __traits(getOverloads, test, "fun"))
        pragma(msg, __traits(getLocation, t));
  }

--
June 27
https://issues.dlang.org/show_bug.cgi?id=23966

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

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@RazvanN7 created dlang/dmd pull request #15353 "Fix Issue 23966 - [REG2.102] Cannot use traits(getAttributes) with overloaded template" fixing this issue:

- Fix Issue 23966 - [REG2.102] Cannot use traits(getAttributes) with overloaded
template

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

--
July 04
https://issues.dlang.org/show_bug.cgi?id=23966

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

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

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15353 "Fix Issue 23966 - [REG2.102] Cannot use traits(getAttributes) with overloaded template" was merged into stable:

- bf2c04df822eee078ec0debb151c09d794f709c9 by RazvanN7:
  Fix Issue 23966 - [REG2.102] Cannot use traits(getAttributes) with overloaded
template

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

--
July 15
https://issues.dlang.org/show_bug.cgi?id=23966

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15417 "merge stable" was merged into master:

- bb88be3bb1cb3c483bb35113c353b7c087ca6e97 by Razvan Nitu:
  Fix Issue 23966 - [REG2.102] Cannot use traits(getAttributes) with overloaded
template (#15353)

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

--