mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
event and error selectors are now allowed to compile time constants
This commit is contained in:
parent
1fbee8259a
commit
42efadb6a1
@ -0,0 +1,7 @@
|
|||||||
|
contract C {
|
||||||
|
error Er();
|
||||||
|
function f() external {}
|
||||||
|
bytes4 constant errorSelector = Er.selector;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 8349: (95-106): Initial value for constant variable has to be compile-time constant.
|
@ -0,0 +1,8 @@
|
|||||||
|
contract C {
|
||||||
|
event Ev();
|
||||||
|
function f() external {}
|
||||||
|
|
||||||
|
bytes32 constant eventSelector = Ev.selector;
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 8349: (96-107): Initial value for constant variable has to be compile-time constant.
|
Loading…
Reference in New Issue
Block a user