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
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
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
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()" );
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
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.
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.
[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