[Issue 4074] New: function overloading fails
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 8 06:42:40 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4074
Summary: function overloading fails
Product: D
Version: 1.057
Platform: x86
OS/Version: Windows
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: digited at yandex.ru
--- Comment #0 from Eugene Zheleznikoff <digited at yandex.ru> 2010-04-08 06:42:39 PDT ---
Created an attachment (id=605)
archive with source code
module common;
class A {}
class B {}
//--------------------------
module import1;
import common;
void foo(B b) {}
//--------------------------
module import2;
import common;
void foo(A a) {}
//--------------------------
module test;
import common, import1, import2;
void main()
{
auto b = new B;
foo(b);
}
//--------------------------
>dmd test.d common.d import1.d import2.d
test.d(8): Error: import1.foo at import1.d(5) conflicts with import2.foo at
import2.d(5)
reproduced on WinXP with DMD 1.051 and 1.057
workaround:
module test;
import common;
import import1 : fooo = foo;
import import2 : fooo = foo;
void main()
{
auto b = new B;
fooo(b);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list