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

--- Comment #3 from RazvanN <razvan.nitu1...@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));
  }

--

Reply via email to