[D1, module, type conflict] Which bug is this?

%u e at ee.com
Mon Nov 1 17:56:01 PDT 2010


The code below results in:

i.d(7): Error: a.B at a.d(2) conflicts with c.B at c.d(4)

changing main to only import i results in:

b.d(4): Error: struct b.B unable to resolve forward reference in definition
a.d(4): Error: struct a.A unable to resolve forward reference in definition
repeated 5 times

--
module main;
import c;

void main(){}
--
module a;
import b : B;

struct A {
  B b;
}
--
module b;
import a : A;

struct B{
  A a;
}
--
module i;
import a;
import b;
import c;

interface I{
  B fb();
}
--
module c;
import i : I;
import a : A;
import b : B;

class C : I{
  this(){}
  B fb(){
    B b;
    return b;
  }
}
--


More information about the Digitalmars-d-learn mailing list