solidity/test/libsolidity/syntaxTests/inheritance/override/override_ambiguous.sol

15 lines
499 B
Solidity
Raw Normal View History

abstract contract A {
2019-09-16 12:33:43 +00:00
int public testvar;
2019-11-05 17:25:34 +00:00
function foo() internal virtual returns (uint256);
2019-09-16 12:33:43 +00:00
}
abstract contract B {
2019-09-16 12:33:43 +00:00
function foo() internal returns (uint256);
2019-11-05 17:25:34 +00:00
function test() internal virtual returns (uint256);
2019-09-16 12:33:43 +00:00
}
abstract contract X is A, B {
2019-09-16 12:33:43 +00:00
int public override testvar;
function test() internal override returns (uint256);
}
// ----
2019-11-05 17:25:34 +00:00
// TypeError: (218-333): Derived contract must override function "foo". Function with the same name and parameter types defined in two or more base classes.