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

23 lines
1.1 KiB
Solidity
Raw Normal View History

2018-11-12 14:14:13 +00:00
contract A {
uint dummy;
2019-11-05 17:25:34 +00:00
function f(uint[] calldata) external virtual pure {}
function g(uint[] calldata) external virtual view { dummy; }
function h(uint[] calldata) external virtual { dummy = 42; }
function i(uint[] calldata) external virtual payable {}
2018-11-12 14:14:13 +00:00
}
contract B is A {
2019-09-16 12:33:43 +00:00
function f(uint[] calldata) external override pure {}
function g(uint[] calldata) external override view { dummy; }
function h(uint[] calldata) external override { dummy = 42; }
function i(uint[] calldata) external override payable {}
function f(uint[] memory) public override pure {}
function g(uint[] memory) public override view { dummy; }
function h(uint[] memory) public override { dummy = 42; }
function i(uint[] memory) public override payable {}
2018-11-12 14:14:13 +00:00
}
// ----
2020-07-06 17:16:21 +00:00
// DeclarationError 1686: (300-353): Function with same name and parameter types defined twice.
// DeclarationError 1686: (358-419): Function with same name and parameter types defined twice.
// DeclarationError 1686: (424-485): Function with same name and parameter types defined twice.
// DeclarationError 1686: (490-546): Function with same name and parameter types defined twice.