[Issue 10806] Interface covariance for more than one interface at once also broken

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 29 14:02:14 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=10806

--- Comment #4 from FeepingCreature <default_357-line at yahoo.de> ---
This problem still exists on master.

To demonstrate why it's a problem:

import std.stdio;

interface A1 { A1 foo(); }
interface A2 { A2 foo(); void bar(); }

class C1 : A1, A2 {
  override C1 foo() { return new C1; }
  override void bar() { writefln("bar"); }
}

void main() {
  A2 x = new C1;
  A2 y = x.foo();
  writefln("X: %s", x.classinfo);
  writefln("Y: %s", y.classinfo);
  y.bar();
}

Note that "A2 y" has an A1 vtable.

--


More information about the Digitalmars-d-bugs mailing list