2019-11-28 15:53:13 +00:00
|
|
|
contract A {
|
2020-07-20 12:45:49 +00:00
|
|
|
function foo() external virtual view returns(uint) { return 5; }
|
2019-11-28 15:53:13 +00:00
|
|
|
}
|
|
|
|
contract B is A {
|
|
|
|
uint public override foo;
|
|
|
|
}
|
|
|
|
contract C is A {
|
2020-07-20 12:45:49 +00:00
|
|
|
function foo() external virtual override view returns(uint) { return 5; }
|
2019-11-28 15:53:13 +00:00
|
|
|
}
|
|
|
|
contract X is B, C {
|
|
|
|
uint public override foo;
|
|
|
|
}
|
|
|
|
// ----
|
2020-06-19 00:26:46 +00:00
|
|
|
// DeclarationError 9097: (245-269): Identifier already declared.
|
|
|
|
// TypeError 1452: (100-124): Cannot override public state variable.
|
|
|
|
// TypeError 4327: (257-265): Public state variable needs to specify overridden contracts "B" and "C".
|