Clash between functions that shouldn't be in the same partial ordering set
TommiT
tommitissari at hotmail.com
Fri Jun 14 16:09:28 PDT 2013
I'm pretty sure the following is a compiler bug, right? (using
DMD 2.063)
---------
module a;
void foo(char)
{
}
---------
module b;
enum MyEnum : int { _ }
void foo(MyEnum)
{
}
---------
module main;
import a;
import b;
void main()
{
foo(char.init);
foo(MyEnum.init); // [1]
}
// 1) Error: b.foo at b.d(5) conflicts with a.foo at a.d(3)
There shouldn't be a problem with this cross-module overloading,
because MyEnum isn't implicitly convertible to char and vice
versa, and thus the partial ordering of functions should consider
a.foo and b.foo unordered.
More information about the Digitalmars-d-learn
mailing list