Bug 7134 – [tdpl] overloading template and non-template functions
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Mac OS X
Creation time
2011-12-18T20:58:00Z
Last change time
2011-12-24T08:32:10Z
Assigned to
nobody
Creator
andrei
Comments
Comment #0 by andrei — 2011-12-18T20:58:15Z
I'm sure this has been filed, but can't find it. If someone knows or finds the other report(s), please mark them as duplicate and keep this.
This TDPL code does not compile:
class A {
// Non-overridable method
A opBinary(string op)(A rhs) {
// Forward to an overridable function
return opBinary(op, rhs);
}
// Overridable method, dispatch string at runtime
A opBinary(string op, A rhs) {
switch (op) {
case "+":
break;
case "-":
break;
}
}
}
Overloading template and non-template functions must be implemented.
Comment #1 by yebblies — 2011-12-24T08:32:10Z
*** This issue has been marked as a duplicate of issue 1528 ***