Bug 12983 – overload not recognized depending on order of declaration
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-06-24T18:59:00Z
Last change time
2017-07-19T17:38:54Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
nilsbossung
Comments
Comment #0 by nilsbossung — 2014-06-24T18:59:11Z
---
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.