aboutsummaryrefslogblamecommitdiffstats
path: root/test/libsolidity/syntaxTests/viewPureChecker/builtin_functions_view_fail.sol
blob: 5356f0b8c666b67c52920ea8cf7e81c3975d15f1 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                       

                                                         

                              

                                                 
     

                                 




                                                                                                                                                                

                                                                                                                                                                
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 {
        (bool success,) = address(this).delegatecall("");
        require(success);
    }
    function j() view public {
        (bool success,) = address(this).call("");
        require(success);
    }
    function() payable external {
    }
}
// ----
// 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: (293-323): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.
// TypeError: (414-436): Function declared as view, but this expression (potentially) modifies the state and thus requires non-payable (the default) or payable.