interface I { }
contract A is I { }
contract B is A { }
contract C is A { }
contract D is B, C { }
What would happen in this situation? How is this kind of diamond inheritance resolved in solidity? Should I be aware of any "gotchas"?
From the docs: The order in which the base classes are listed matters. C
will override B
to the extent they share content in common.
For 'gotchas:' If there are multiple different kinds of functions with the same name, an error might be produced; details are here (reposted in part under GPL):
When the inheritance results in a contract with a function and a modifier of the same name, it is considered as an error. This error is produced also by an event and a modifier of the same name, and a function and an event of the same name. As an exception, a state variable getter can override a public function.