D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7134 - [tdpl] overloading template and non-template functions
Summary: [tdpl] overloading template and non-template functions
Status: RESOLVED DUPLICATE of issue 1528
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Mac OS X
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-18 20:58 UTC by Andrei Alexandrescu
Modified: 2011-12-24 08:32 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrei Alexandrescu 2011-12-18 20:58:15 UTC
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 yebblies 2011-12-24 08:32:10 UTC

*** This issue has been marked as a duplicate of issue 1528 ***