mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Adding sol->yul for f.selector and f.address
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
contract C {
|
||||
function f() external returns (address) {
|
||||
return this.f.address;
|
||||
}
|
||||
function g() external returns (bool) {
|
||||
return this.f.address == address(this);
|
||||
}
|
||||
function h(function() external a) public returns (address) {
|
||||
return a.address;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x0fdd67305928fcac8d213d1e47bfa6165cd0b87b
|
||||
// g() -> true
|
||||
// h(function): left(0x1122334400112233445566778899AABBCCDDEEFF42424242) -> 0x1122334400112233445566778899AABBCCDDEEFF
|
||||
@@ -0,0 +1,13 @@
|
||||
contract C {
|
||||
function f() external returns (bytes4) {
|
||||
return this.f.selector;
|
||||
}
|
||||
function h(function() external a) public returns (bytes4) {
|
||||
return a.selector;
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> left(0x26121ff0)
|
||||
// h(function): left(0x1122334400112233445566778899AABBCCDDEEFF42424242) -> left(0x42424242)
|
||||
Reference in New Issue
Block a user