[Issue 12983] New: overload not recognized depending on order of declaration
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Jun 24 11:59:11 PDT 2014
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 at puremagic.com
Reporter: nilsbossung at 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.
--
More information about the Digitalmars-d-bugs
mailing list