www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23455] New: Public import + mixin template + overload


          Issue ID: 23455
           Summary: Public import + mixin template + overload definition
                    for a package function fails overload resolution
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: msnmancini hotmail.com

Here I show the minimal reproducible bug.


import std.stdio;
import bug.test_float;

void main()
    writeln("Hello ", add(10, 10));

module bug.test_float;
public import bug.test_pkg_int;

mixin template GenerateAdd()
    float add(float a, float b){return a+b;}

mixin GenerateAdd;

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

Nov 03 2022