mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow overriding operators for enums
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using {add as +} for E;
|
||||
|
||||
enum E {
|
||||
E1,
|
||||
E2
|
||||
}
|
||||
|
||||
function add(E, E) pure returns (E) {
|
||||
return E.E1;
|
||||
}
|
||||
|
||||
// ----
|
||||
// TypeError 9921: (0-23): The "using" directive cannot be used to attach functions to the enum type.
|
||||
Reference in New Issue
Block a user