[Issue 2244] New: implementing a function with an alias is impossible

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 24 11:26:27 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2244

           Summary: implementing a function with an alias is impossible
           Product: D
           Version: 1.033
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: elite01 at gmx.de


Following source:

interface Intf {
        public void doIt();
}

class Impl : Intf {
        public void impl() { /*empty*/ }

        public alias impl doIt;
}

void main() {
        (new Impl()).doIt;
}

Gives an error when compiled:
main.d:5: class main.Impl interface function Intf.doIt isn't implemented

The same happens with an abstract superclass, while it works when Impl doesn't
extends Intf.
While this is just a test case, I stumbled upon this trying to implement
functions using a template, like:
  public alias EventHandler!(`mouseMove`, int, int) mouseMove;
I changed the code back to use string mixins, but I'd love to see something
like the above work.


-- 



More information about the Digitalmars-d-bugs mailing list