solidity/test/libsolidity/syntaxTests/viewPureChecker/array/access_to_array_push_view.sol

9 lines
273 B
Solidity

contract A {
uint[] x;
function f() public view returns (uint) {
return x.push();
}
}
// ----
// TypeError: (88-96): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.