aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/returning_structs_fail.sol
blob: e04d082544c730b5de1abd4391da062bddad89a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
contract C {
    struct S { uint x; }
    S s;
    function f() pure internal returns (S storage) {
        return s;
    }
    function g() pure public {
        f().x;
    }
}
// ----
// TypeError: (115-116): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
// TypeError: (163-168): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".