Bug 21491 – Can't enumerate overload set from mixin templates

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-12-19T10:24:13Z
Last change time
2024-12-13T19:13:31Z
Assigned to
No Owner
Creator
Vladimir Panteleev
Moved to GitHub: dmd#19841 →

Comments

Comment #0 by dlang-bugzilla — 2020-12-19T10:24:13Z
If functions with the same name across several mixed-in mixin templates create an overload set, it is invisible to getOverloads: ///////////////////////// test.d ///////////////////////// struct A { void ov(int){} void ov(string){} } struct B { mixin template M() { void ov(int){} void ov(string){} } mixin M; } struct C { mixin template M(T) { void ov(T){} } mixin M!int; mixin M!string; } pragma(msg, __traits(getOverloads, A, q{ov})); // OK pragma(msg, __traits(getOverloads, B, q{ov})); // OK pragma(msg, __traits(getOverloads, C, q{ov})); // nothing? ////////////////////////////////////////////////////////// This is despite that the functions otherwise act like an overload set, i.e.: C c; c.ov(1); c.ov("2"); works as expected.
Comment #1 by robert.schadek — 2024-12-13T19:13:31Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19841 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB