2018-06-04 11:54:32 +00:00
|
|
|
contract C {
|
2018-07-04 09:25:45 +00:00
|
|
|
uint x;
|
2018-06-04 11:54:32 +00:00
|
|
|
function f() pure public { g(); }
|
2018-07-04 09:25:45 +00:00
|
|
|
function g() view public { x; }
|
|
|
|
function h() view public { i(); }
|
|
|
|
function i() public { x = 2; }
|
2018-06-04 11:54:32 +00:00
|
|
|
}
|
|
|
|
// ----
|
2020-06-19 00:26:46 +00:00
|
|
|
// TypeError 2527: (56-59): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
|
2022-02-17 15:52:36 +00:00
|
|
|
// TypeError 8961: (130-133): Function cannot be declared as view because this expression (potentially) modifies the state.
|