Open
Description
Using functions as getters is quite common and it would be good to support them in specs, such as modifies
or require
. The following currently fails for two reasons:
- modifies spec fails because it introduces new statements
- require just puts
true
in the assume
pragma solidity >=0.5.0;
contract Issue78 {
bool b;
function isSet() public view returns (bool set) {
return b;
}
/// @notice modifies b if !isSet()
function set() public {
require(!isSet());
b = true;
}
}
Current output
solc-verify.py Issue78.sol
Error while running compiler, details:
Warning: This is a pre-release compiler version, please do not use it in production.
======= Converting to Boogie IVL =======
======= Issue78.sol =======
Issue78.sol:12:3: solc-verify error: Annotation expression introduces intermediate statements
function set() public {
^ (Relevant source part starts here and spans across multiple lines).
Issue78.sol:12:3: solc-verify error: Annotation expression introduces intermediate declarations
function set() public {
^ (Relevant source part starts here and spans across multiple lines).
solc-verify warning: Balance modifications due to gas consumption or miner rewards are not modeled
Issue78.sol:12:3: solc-verify error: Error(s) while processing annotation for node
function set() public {
^ (Relevant source part starts here and spans across multiple lines).