solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Require statement with constant string field

Open beillahi opened this issue 5 years ago • 2 comments
trafficstars

pragma solidity ^0.5.0;


contract test {

    string constant a = "solc-verify" ;

    function g() public {
       require(true, a);
    }
}
-----------------
Error while running verifier, details:
[TRACE] Using prover: /usr/bin/z3
Parsing /tmp/tmp505k52p_/test9.sol.bpl
/tmp/tmp505k52p_/test9.sol.bpl(23,1): Error: mismatched types in assignment command (cannot assign int_arr_type to int_arr_ptr)
1 type checking errors detected in /tmp/tmp505k52p_/test9.sol.bpl

beillahi avatar Dec 03 '19 15:12 beillahi

I'll have to check but I think we can just simply ignore the second argument of require as it is only a message.

hajduakos avatar Dec 04 '19 13:12 hajduakos

This is actually a special case of #123

hajduakos avatar Mar 16 '20 15:03 hajduakos