mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
22 lines
337 B
Solidity
22 lines
337 B
Solidity
library L {
|
|
struct S {
|
|
uint256[] data;
|
|
}
|
|
function f(S memory _s) internal pure returns (uint256) {
|
|
require(_s.data.length > 0);
|
|
return 42;
|
|
}
|
|
}
|
|
|
|
contract C {
|
|
using L for L.S;
|
|
function f() public pure returns (uint256 y) {
|
|
L.S memory x;
|
|
y = (x.f)();
|
|
assert(y == 42); // should hold
|
|
}
|
|
}
|
|
// ====
|
|
// SMTEngine: all
|
|
// ----
|