solidity/test/libsolidity/syntaxTests/inheritance/override/public_var_parallel_funciton.sol
2022-04-01 23:41:18 -05:00

11 lines
461 B
Solidity

interface A {
function foo() external returns (uint);
}
contract B {
uint public foo;
}
contract X is A, B {
}
// ----
// TypeError 6480: (96-118='contract X is A, B { }'): Derived contract must override function "foo". Two or more base classes define function with same name and parameter types. Since one of the bases defines a public state variable which cannot be overridden, you have to change the inheritance layout or the names of the functions.