Self-reference in interface definition

Jason House jason.james.house at gmail.com
Tue May 15 21:19:22 PDT 2007


While the code below does not compile, I believe that it should be 
allowed.  Requiring something that implements an interface to accept 
other objects conforming to the interface should always be allowed.  The 
specific problem below makes perfect sense to disallowed for classes, 
but does not for interfaces.

== test.d ==
interface X{
   X opAssign(X);
}

== gdc output ==
test.d:2: function test.X.opAssign identity assignment operator overload 
is illegal



More information about the Digitalmars-d mailing list