aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/selector_complex.sol
blob: 311dec4a4944d50141eb7a54f5d96da5c7006f27 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
contract C {
    function f(C c) pure public returns (C) {
        return c;
    }
    function g() pure public returns (bytes4) {
        // By passing `this`, we read from the state, even if f itself is pure.
        return f(this).f.selector;
    }
}
// ----
// TypeError: (228-232): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".