Re: interface and class inheritance

2013-11-17 Thread Stretto
On Thursday, 14 November 2013 at 21:20:57 UTC, Oleg B wrote: [code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" ); } } class C: B, A { } void main() { auto c = new C; c.funcA(); } [code/] $ dmd -run interface.d interface.d(6): Er

Re: interface and class inheritance

2013-11-17 Thread Chris Nicholson-Sauls
I had thought the pattern alias B.funcA funcA; was supposed to solve things like this, but it does not work. Any reason it couldn't be made to? Or, for that matter, why inherited members are not considered by interfaces in the first place? In related news, if you simply leave A out of

Re: interface and class inheritance

2013-11-15 Thread Jacob Carlborg
On 2013-11-14 23:17, Oleg B wrote: Oh sorry i mean interface A { void funcA(); } class B : A { final void funcA() { writeln( "B.funcA()" ); } } class C : B { } we can't change anything in class B I would have moved "final void funcA()" to a template and mixin it in both B and C, but

Re: interface and class inheritance

2013-11-14 Thread Oleg B
On Thursday, 14 November 2013 at 21:45:11 UTC, Agustin wrote: On Thursday, 14 November 2013 at 21:42:38 UTC, Agustin wrote: On Thursday, 14 November 2013 at 21:20:57 UTC, Oleg B wrote: [code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" );

Re: interface and class inheritance

2013-11-14 Thread Agustin
On Thursday, 14 November 2013 at 21:20:57 UTC, Oleg B wrote: [code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" ); } } class C: B, A { } void main() { auto c = new C; c.funcA(); } [code/] $ dmd -run interface.d interface.d(6): Er

Re: interface and class inheritance

2013-11-14 Thread Agustin
On Thursday, 14 November 2013 at 21:42:38 UTC, Agustin wrote: On Thursday, 14 November 2013 at 21:20:57 UTC, Oleg B wrote: [code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" ); } } class C: B, A { } void main() { auto c = new C; c.

Re: interface and class inheritance

2013-11-14 Thread Ali Çehreli
On 11/14/2013 01:20 PM, Oleg B wrote: [code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" ); } } class C: B, A { } void main() { auto c = new C; c.funcA(); } [code/] $ dmd -run interface.d interface.d(6): Error: class interface.

interface and class inheritance

2013-11-14 Thread Oleg B
[code] import std.stdio; interface A { void funcA(); } class B { final void funcA() { writeln( "B.funcA()" ); } } class C: B, A { } void main() { auto c = new C; c.funcA(); } [code/] $ dmd -run interface.d interface.d(6): Error: class interface.C interface function 'void funcA()' is n