solidity/test/libsolidity/semanticTests/inlineAssembly/external_function_pointer_address_assignment.sol
2022-05-19 20:23:28 +02:00

18 lines
360 B
Solidity

contract C {
function testFunction() external {}
function testYul(address newAddress) view public returns (address adr) {
function() external fp = this.testFunction;
assembly {
fp.address := newAddress
}
return fp.address;
}
}
// ====
// ----
// testYul(address): 0x1234567890 -> 0x1234567890
// testYul(address): 0xC0FFEE3EA7 -> 0xC0FFEE3EA7