Bug 20833 – Template members prevent __traits(getOverloads) from working properly

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-05-15T13:27:44Z
Last change time
2020-06-18T11:54:00Z
Keywords
pull
Assigned to
No Owner
Creator
Richard Manthorpe

Comments

Comment #0 by rmanth — 2020-05-15T13:27:44Z
struct P { void foo(T)(T t) {} void foo(long l) {} this(T)(T t) {} this(long l) {} } static assert(__traits(getOverloads, P, "foo").length == __traits(getOverloads, P.init, "foo").length); static assert(__traits(getOverloads, P, "__ctor").length == __traits(getOverloads, P.init, "__ctor").length); Both static asserts fail. It worked in dmd-2.080.1 and stopped working in dmd-2.081.0.
Comment #1 by rmanth — 2020-05-15T13:36:13Z
It looks like it broke when the third argument for `__traits(getOverloads)` was added. Note that adding a third argument doesn't help.
Comment #2 by rmanth — 2020-05-15T13:49:42Z
https://issues.dlang.org/show_bug.cgi?id=16206 Is the same problem - perhaps it was never actually fixed.
Comment #3 by dlang-bot — 2020-06-18T05:57:54Z
@rmanthorpe created dlang/dmd pull request #11295 "Fix Issue 20833 - Template members prevent __traits(getOverloads) from working properly" fixing this issue: - Fix Issue 20833 - Template members prevent __traits(getOverloads) from working properly https://github.com/dlang/dmd/pull/11295
Comment #4 by dlang-bot — 2020-06-18T11:54:00Z
dlang/dmd pull request #11295 "Fix Issue 20833 - Template members prevent __traits(getOverloads) from working properly" was merged into stable: - db12c87031caa8a083556181572eab12e1e63d1c by Richard Manthorpe: Fix Issue 20833 - Template members prevent __traits(getOverloads) from working properly https://github.com/dlang/dmd/pull/11295