D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4074 - function overloading fails
Summary: function overloading fails
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-08 06:42 UTC by Eugene Zheleznikoff
Modified: 2018-04-20 08:17 UTC (History)
2 users (show)

See Also:


Attachments
archive with source code (622 bytes, application/x-zip-compressed)
2010-04-08 06:42 UTC, Eugene Zheleznikoff
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Eugene Zheleznikoff 2010-04-08 06:42:39 UTC
Created attachment 605 [details]
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);
}
Comment 1 Simen Kjaeraas 2018-04-20 08:17:36 UTC
Cannot replicate this on 2.079.1 under Windows 10.