If I have an interface A
and interface B
that extends A
, can I create a contract class BContract
that inherits AContract
?
If I try this, I get the following warning:
(1,1): warning CC1066: CodeContracts: Class 'BContract' is annotated as being the contract for the interface 'B' and cannot have an explicit base class other than System.Object.
I haven't tested this yet, but I assume that the implementation of the A
interface in BContract
is ignored, and the contracts specified in AContract
take precedence - in other words I can stub out all methods and properties from A
.
I appreciate that it's not a massive inconvenience to do this, but it does seem to lack clarity for anyone looking at BContract
. It would save time, space and understanding to be able to derive BContract
from AContract
, so why is this not supported?