Add type().min/max for enums

This commit is contained in:
Marenz
2021-09-01 15:02:02 +02:00
parent 1e334a8993
commit 2b28f87abf
17 changed files with 85 additions and 25 deletions
@@ -0,0 +1,12 @@
contract test {
enum MinMax { A, B, C, D }
function min() public returns(uint) { return uint(type(MinMax).min); }
function max() public returns(uint) { return uint(type(MinMax).max); }
}
// ====
// compileViaYul: also
// ----
// min() -> 0
// max() -> 3