aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/overriding_fail.sol
blob: 61702495b42f4d6a04e86caf84ede2b64ae3576c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
contract D {
    uint x;
    function f() public view { x; }
    function g() public pure {}
}
contract C1 is D {
    function f() public {}
    function g() public view {}
}
contract C2 is D {
    function g() public {}
}
// ----
// TypeError: (118-140): Overriding function changes state mutability from "view" to "nonpayable".
// TypeError: (145-172): Overriding function changes state mutability from "pure" to "view".
// TypeError: (198-220): Overriding function changes state mutability from "pure" to "nonpayable".