2020-11-26 16:14:58 +00:00
|
|
|
contract C {
|
|
|
|
struct S {
|
|
|
|
string s;
|
|
|
|
bytes b;
|
|
|
|
}
|
|
|
|
|
|
|
|
S public m;
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
m.s = "foo";
|
|
|
|
m.b = "bar";
|
|
|
|
}
|
|
|
|
|
|
|
|
function f() public view {
|
|
|
|
(string memory s, bytes memory b) = this.m();
|
|
|
|
assert(keccak256(bytes(s)) == keccak256(bytes(m.s))); // should hold
|
|
|
|
assert(b[0] == m.b[0]); // should hold
|
|
|
|
assert(b[0] == "t"); // should fail
|
|
|
|
}
|
|
|
|
}
|
2021-03-31 15:11:54 +00:00
|
|
|
// ====
|
|
|
|
// SMTEngine: all
|
2020-11-26 16:14:58 +00:00
|
|
|
// ----
|
2022-11-23 15:51:06 +00:00
|
|
|
// Warning 6328: (307-326): CHC: Assertion violation happens here.
|
2023-02-09 16:07:13 +00:00
|
|
|
// Info 1391: CHC: 5 verification condition(s) proved safe! Enable the model checker option "show proved safe" to see all of them.
|