event and error selectors are now allowed to compile time constants

This commit is contained in:
nishant-sachdeva 2022-06-22 21:29:39 +05:30
parent 1fbee8259a
commit 42efadb6a1
2 changed files with 15 additions and 0 deletions

View File

@ -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.

View File

@ -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.