www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12983] New: overload not recognized depending on order of

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

          Issue ID: 12983
           Summary: overload not recognized depending on order of
                    declaration
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: nilsbossung googlemail.com

---
cat > test.d << code
alias I = int;
class B(T) {alias MyC = C!string;}
class C(T) : B!float
{
    void m() {f(0);}
}
alias MyB = B!float;
void f();
void f(I);
code
dmd -c -o- test.d
---
test.d(5): Error: None of the overloads of 'f' are callable using argument
types (int), candidates are:
test.d(8):        test.f()
test.d(9):        test.f(I)
test.d(2): Error: template instance test.C!string error instantiating
test.d(7):        instantiated from here: B!float
---

Works when f(I) is declared before f() or before MyB.

--
Jun 24 2014