aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol
blob: 9b00fd6d0825ece83e318465f71c5d5c5175ab7e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
contract C {
    function f() view public {
        address(this).transfer(1);
    }
    function g() view public {
        require(address(this).send(2));
    }
    function h() view public {
        selfdestruct(address(this));
    }
    function i() view public {
        require(address(this).delegatecall(""));
    }
    function j() view public {
        require(address(this).call(""));
    }
}
// ----
// TypeError: (52-77): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (132-153): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (201-228): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (283-313): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (369-391): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.