On 4/3/16 7:59 AM, tost wrote:
On Wednesday, 30 March 2016 at 11:03:51 UTC, Martin Nowak wrote:
Second beta for the 2.071.0 release.


Please report any bugs at https://issues.dlang.org


module foo;

void main() {}

class A {

     void bar(int i) {}

     void baz() {
         import othermodule;

// othermodule.d
module othermodule;

void bar(string s) {}

compiled with

dmd foo.d othermodule.d


foo.d(11): Error: function foo.A.bar (int i) is not callable using
argument types (string)

is this a feature of the new name lookup algorithm or a bug? Adapting my
codebase would be trivial :)

Yes. There are new lookup rules. See my post about it here: http://www.schveiguy.com/blog/2016/03/import-changes-in-d-2-071/

To fix, you should import with selective:

import othermodule: bar;

If you need both bar(int) and bar(string) from their respective locations, I'd suggest a renaming import.


Reply via email to