solidity/test/libsolidity/semanticTests/inlineAssembly/external_function_pointer_address_assignment.sol

17 lines
352 B
Solidity
Raw Normal View History

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