Bug 23455 – Public import + mixin template + overload definition for a package function fails overload resolution

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-11-03T12:50:27Z
Last change time
2024-12-13T19:25:26Z
Assigned to
No Owner
Creator
Marcelo Silva Nascimento Mancini
Moved to GitHub: dmd#20177 →

Comments

Comment #0 by msnmancini — 2022-11-03T12:50:27Z
Here I show the minimal reproducible bug. app.d: ```d import std.stdio; import bug.test_float; void main() { writeln("Hello ", add(10, 10)); } ``` bug/test_float.d: ```d module bug.test_float; public import bug.test_pkg_int; mixin template GenerateAdd() { float add(float a, float b){return a+b;} } mixin GenerateAdd; ``` bug/test_pkg_int.d: ```d module bug.test_pkg_int; package int add(int a, int b){return a+b;} ``` The error: app.d(6): Error: function bug.test_float.GenerateAdd!().add at bug\test_float.d(6) conflicts with function bug.test_pkg_int.add at bug\test_pkg_int.d(3)
Comment #1 by msnmancini — 2022-11-03T12:51:01Z
If I don't use the mixin templat eto generate that overload, this error does not happen
Comment #2 by robert.schadek — 2024-12-13T19:25:26Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20177 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB