www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2683] New: Cannot implement interface methods by alias

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2683

           Summary: Cannot implement interface methods by alias
           Product: D
           Version: 1.039
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: dhasenan gmail.com


interface IFoo
{
   void foo();
}

class Foo : IFoo
{
   void bar() {}
   alias bar foo;
}
// class iface_alias.Foo interface function IFoo.foo isn't implemented

This is a problem for me because I want to implement methods with a template,
but my choices for that template are a string mixin or a template mixin, and
with a template mixin, I have to alias the template to the desired method.

String mixins don't work for this; for example, if the return type is a

a public alias to a private type. I'm not aware of a workaround for this
(anything that requires manual coding aside from the template is not a valid
workaround).


-- 
Feb 22 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2683


dhasenan gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|1.039                       |1.00





ClassDeclaration::findFunc goes through the class's vtbl, and aliases don't
make it into the vtbl.

It doesn't matter if I force the function to be virtual by overriding it.

I can duplicate this on dmd 1.00.


-- 
Feb 22 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2683


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com





This is a generalisation of issue 2565/issue 502.


-- 
Feb 22 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2683


Fawzi Mohamed <fawzi gmx.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |elite01 gmx.de



*** Issue 2244 has been marked as a duplicate of this issue. ***

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