www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15120] New: alias overload set combine error message

https://issues.dlang.org/show_bug.cgi?id=15120

          Issue ID: 15120
           Summary: alias overload set combine error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: john.loughran.colvin gmail.com

//modA.d
auto foo(T)(T a){}

//modB.d
auto foo(T)(T a){}

//modC.d
import modB, modC;
alias foo = modB.foo;
alias foo = modC.foo;

void main()
{
    .foo(3.4f);
}

modA.d(7): Error: modA.foo called with argument types (float) matches both:
modB.d(1):     modB.foo!float.foo(float a)
and:
modC.d(1):     modC.foo!float.foo(float a)

which makes perfect sense. However, if we drop the . before foo, i.e.
    foo(3.4f);

modA.d(7): Error: overload alias 'foo' is not a variable

which is very odd.

--
Sep 26 2015