solidity/test/libsolidity/syntaxTests/viewPureChecker/overriding_fail.sol

17 lines
549 B
Solidity
Raw Normal View History

2018-07-04 09:25:45 +00:00
contract D {
uint x;
function f() public view { x; }
function g() public pure {}
}
contract C1 is D {
2019-09-16 12:33:43 +00:00
function f() public override {}
function g() public override view {}
2018-07-04 09:25:45 +00:00
}
contract C2 is D {
2019-09-16 12:33:43 +00:00
function g() public override {}
2018-07-04 09:25:45 +00:00
}
// ----
2019-09-16 12:33:43 +00:00
// TypeError: (118-149): Overriding function changes state mutability from "view" to "nonpayable".
// TypeError: (154-190): Overriding function changes state mutability from "pure" to "view".
// TypeError: (216-247): Overriding function changes state mutability from "pure" to "nonpayable".