[Issue 17462] Order of base interfaces affects compiler behavior

2022-12-17 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

Iain Buclaw  changed:

   What|Removed |Added

   Priority|P1  |P3

--


[Issue 17462] Order of base interfaces affects compiler behavior

2018-01-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

--- Comment #4 from Andrei Alexandrescu  ---
The following C++ equivalent does require the additional implementation
(uncomment code to get it to compile):


class Marker {};
class Foo { public: virtual void foo() = 0; };

class FooMarked : public Foo, public Marker {};
class MarkedFoo : public Marker, public Foo  {};

class Base : public Foo { virtual void foo() {} };

class Derived1 : public Base, public FooMarked {
//virtual void foo() {}
}; 
class Derived2 : public Base, public MarkedFoo {
//virtual void foo() {}
};

int main() {
auto d1 = new Derived1;
auto d2 = new Derived2;
}


However, this other code, which arguably is closer in spirit, does work:


class Marker {};
class Foo { public: virtual void foo() = 0; };

class FooMarked : virtual public Foo, public Marker {};
class MarkedFoo : public Marker, virtual public Foo  {};

class Base : virtual public Foo { virtual void foo() {} };

class Derived1 : public Base, public FooMarked {}; 
class Derived2 : public Base, public MarkedFoo {};

int main() {
auto d1 = new Derived1;
auto d2 = new Derived2;
}


--


[Issue 17462] Order of base interfaces affects compiler behavior

2018-01-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

Rainer Schuetze  changed:

   What|Removed |Added

 CC||r.sagita...@gmx.de

--- Comment #3 from Rainer Schuetze  ---
I always considered it a great relief that you don't have to reimplement common
interfaces. Otherwise COM-programming would be much more verbose. What's the
reasoning to disallow it?

The old samples in dmd/samples also assume that IUnknown doesn't have to be
reimplemented.

--


[Issue 17462] Order of base interfaces affects compiler behavior

2018-01-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

Andrei Alexandrescu  changed:

   What|Removed |Added

 CC||and...@erdani.com

--- Comment #2 from Andrei Alexandrescu  ---
FWIW the Java code works without requiring the additional implementation:

interface Marker {}
interface Foo { void foo(); }

interface FooMarked extends Foo, Marker {}
interface MarkedFoo extends Marker, Foo  {}

class Base implements Foo { public void foo() {} }

class Derived1 extends Base implements FooMarked {} // Inherit Base.foo
class Derived2 extends Base implements MarkedFoo {} // Inherit Base.foo

--


[Issue 17462] Order of base interfaces affects compiler behavior

2018-01-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

RazvanN  changed:

   What|Removed |Added

 CC||razvan.nitu1...@gmail.com

--- Comment #1 from RazvanN  ---
PR : https://github.com/dlang/dmd/pull/7684

--


[Issue 17462] Order of base interfaces affects compiler behavior

2018-01-12 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17462

RazvanN  changed:

   What|Removed |Added

   Severity|enhancement |normal

--