Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chisel Enum Error #7050

Closed
1 of 2 tasks
parseb opened this issue Feb 8, 2024 · 0 comments · Fixed by #7173
Closed
1 of 2 tasks

Chisel Enum Error #7050

parseb opened this issue Feb 8, 2024 · 0 comments · Fixed by #7173
Labels
T-bug Type: bug

Comments

@parseb
Copy link

parseb commented Feb 8, 2024

Component

Chisel

Have you ensured that all of these are up to date?

  • Foundry
  • 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>
`
@parseb parseb added the T-bug Type: bug label Feb 8, 2024
@gakonst gakonst added this to Foundry Feb 8, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Feb 8, 2024
@jenpaff jenpaff moved this from Todo to Completed in Foundry Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant