www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2244] New: implementing a function with an alias is impossible

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: elite01 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.


-- 
Jul 24 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2244


Fawzi Mohamed <fawzi gmx.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |fawzi gmx.ch
         Resolution|                            |DUPLICATE


--- Comment #1 from Fawzi Mohamed <fawzi gmx.ch> 2010-04-14 07:49:12 PDT ---
duplicate of #2683, that has a better discussion (even if it is newer)

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 14 2010