[Issue 8667] selective import breaks normal overload resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 9 17:58:22 PST 2013


http://d.puremagic.com/issues/show_bug.cgi?id=8667



--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-01-09 17:58:21 PST ---
With current dmd implementation, this is an expected behavior.
(But, I'm not sure whether is an expected language design.)

A selective import adds an alias declaration in importing module. So:

  import m;
  import m2: split; //removing : split makes it work

is same as:

  import m;
  import m2;
  alias split = m2.split;
  // in here, the name `split` has just one overload m2.split
  // (does not contain m1.split)

Therefore, in main, split("abc") does not match any function template
declaration.

===

In addition, renamed import works as same way. With current implementation,

  import m : x = split;

behaves same as:

  import m;
  alias x = m.split;

-- 
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