[Issue 23455] New: Public import + mixin template + overload definition for a package function fails overload resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 3 12:50:27 UTC 2022


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

          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 at puremagic.com
          Reporter: msnmancini at hotmail.com

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)

--


More information about the Digitalmars-d-bugs mailing list