[Issue 2683] New: Cannot implement interface methods by alias

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Feb 22 07:05:15 PST 2009


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 at digitalmars.com
        ReportedBy: dhasenan at 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
templated class, string mixins will fail (see #1748). Or if the return type is
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).


-- 



More information about the Digitalmars-d-bugs mailing list