foundry
foundry copied to clipboard
Chisel Enum Error
Component
Chisel
Have you ensured that all of these are up to date?
- [ ] Foundry
- [X] Foundryup
What version of Foundry are you on?
forge 0.2.0 (a5efe4f 2024-02-08T00:15:08.598684835Z)
What command(s) is the bug in?
No response
Operating System
Linux
Describe the bug
Both .min
and .max
result in an error.
Expected:
Using type(NameOfEnum).min and type(NameOfEnum).max you can get the smallest and respectively largest value of the given enum.
Possibly related to tracking issue of better support for Enums. #6623
➜ `enum State {
Default,
Staging,
Buy,
Sell,
Liquidated
}
➜ type(State).max
The application panicked (crashed).
Message: called Option::unwrap()
on a None
value
Location: crates/chisel/src/executor.rs:866
This is a bug. Consider reporting it at https://github.com/foundry-rs/foundry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⋮ 7 frames hidden ⋮
8: core::panicking::panic::h195fc2a96298d4c3
at <unknown source file>:<unknown line>
9: chisel::executor::Type::map_special::h151c12f6d722df5c
at <unknown source file>:<unknown line>
10: chisel::executor::Type::ethabi::h0e439eab7b54f24d
at <unknown source file>:<unknown line>
11: chisel::executor::<impl chisel::session_source::SessionSource>::inspect::{{closure}}::h1a0548334a09414c
at <unknown source file>:<unknown line>
12: chisel::dispatch_repl_line::{{closure}}::he2b87f776dbef9b1
at <unknown source file>:<unknown line>
13: chisel::main::{{closure}}::he29b828614cf8d85
at <unknown source file>:<unknown line>
14: chisel::main::h0986f1d68b109ab6
at <unknown source file>:<unknown line>
15: std::sys_common::backtrace::__rust_begin_short_backtrace::had39d0632b653d75
at <unknown source file>:<unknown line>
16: std::rt::lang_start::h7d2bc1e3d88727f7
at <unknown source file>:<unknown line>
17: __libc_start_call_main<unknown>
at ./csu/../sysdeps/nptl/libc_start_call_main.h:58
18: __libc_start_main_impl<unknown>
at ./csu/../csu/libc-start.c:392
19: _start<unknown>
at <unknown source file>:<unknown line>
`