aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/call_internal_functions_fail.sol
blob: e21037bd933607501371439420a74c3037e5efc9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
contract C {
    uint x;
    function f() pure public { g(); }
    function g() view public { x; }
    function h() view public { i(); }
    function i() public { x = 2; }
}
// ----
// TypeError: (56-59): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
// TypeError: (130-133): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.