Your class AnotherInterfaceImpl
is not actually implementing all members of AnotherInterface
. The public property AnotherInterfaceImpl.member1
must have type MyInterface
, not MyInterfaceImpl
.
Note that this restriction only applies to the public property. The private field AnotherInterfaceImpl._member1
can still be of type MyInterfaceImpl
, because MyInterfaceImpl
implements MyInterface
.