aboutsummaryrefslogblamecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/function_types_fail.sol
blob: d00f65c9b4345aedee03bbd40d5c564ae751319f (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                                                                                
contract C {
    function f() pure public {
        function () external nonpayFun;
        nonpayFun();
    }
    function g() pure public {
        function () external view viewFun;
        viewFun();
    }
    function h() view public {
        function () external nonpayFun;
        nonpayFun();
    }
}
// ----
// TypeError: (92-103): Function declared as pure, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (193-202): Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
// TypeError: (289-300): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.