It works with function overload set, but doesn't work with template overload set. Test case: ------------------------- module a; auto foo(int) { return 1; } template Bar(int n) { enum Bar = 1; } ------------------------- module b; auto foo(long) { return 2; } template Bar(long n) { enum Bar = 2; } ------------------------- module test; import a, b; alias foo = a.foo; alias foo = b.foo; // OK static assert(foo(1) == 1); // OK static assert(foo(1L) == 2); // OK alias Bar = a.Bar; // test.d(9) alias Bar = b.Bar; // doesn't work [X] //static assert(Bar!1 == 1); //static assert(Bar!1L == 2); ------------------------- [X]: test.d(10): Error: alias test.Bar conflicts with alias test.Bar at test.d(9)
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5019a5798ffd2c3154e870966c038185330a2c36 fix Issue 10658 - Cannot merge template overload set by using alias declaration - Add OverDeclaration and see it in overloadApply. - Use OverDeclaration for template overload set merging. - Check OverDeclaration in DotVarExp and VarExp. https://github.com/D-Programming-Language/dmd/commit/994f1ead17bdf9a3c4a3e414395b14c4d897245e Merge pull request #2417 from 9rnsr/fix10658 Issue 10658 - Cannot merge template overload set by using alias declaration