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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 11 23:03:57 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10806



--- Comment #1 from Infiltrator <lt.infiltrator at gmail.com> 2013-08-11 23:03:56 PDT ---
Code and output for easy perusal.

----------------------
import std.stdio;

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

class C1 : A1, A2 {
  override C1 foo() { return new C1; }
}

interface B1 { B1 foo(); }
interface B2 { B2 foo(); }

class C2 : B2, B1 {
  override C2 foo() { return new C2; }
}

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


  B2 a = new C2;
  B2 b = a.foo();
  writefln("A: %s", a.classinfo);
  writefln("B: %s", b.classinfo);
}
-----------------------
Application output:

X: f230.A2
Y: f230.A1
A: f230.B2
B: f230.B2

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list