[Issue 20821] Aliased template method confuses overload resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 11 18:12:07 UTC 2020


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

--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
Another way to makes this works

  static assert(S().fun() == 1); // explicit call with "()"

It looks like the overload set is not build corectly.
This is confirmed by

  struct S {
    int gun()(int i) { return 0; }
    alias fun = gun;
    int fun() { return 1; }
  }

  static assert(S().fun() == 1); // Error
  static assert(__traits(getOverloads, S, "fun", true).length == 2);

while if the non templatized fun is declared before gun then the overload set
has well its length equal to 2.

--


More information about the Digitalmars-d-bugs mailing list