solidity/test/libsolidity/semanticTests/various/code_length_contract_member.sol
Daniel Kirchner a8f7c69c47 Adjust tests.
2021-09-13 20:41:40 +02:00

20 lines
435 B
Solidity

// Test to see if type.code.length does extcodesize(type) only when type is an address.
struct S {
bytes32 code;
bytes32 another;
}
contract C {
S s;
function f() public returns (uint, uint, bool) {
return (s.code.length, s.another.length, address(this).code.length > 50);
}
}
// ====
// requiresYulOptimizer: minimalStack
// compileToEwasm: also
// compileViaYul: also
// ----
// f() -> 0x20, 0x20, true