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

[Bug] Invalid input values causes rust panic #1041

Closed
0rphon opened this issue Jun 16, 2021 · 0 comments · Fixed by #1054
Closed

[Bug] Invalid input values causes rust panic #1041

0rphon opened this issue Jun 16, 2021 · 0 comments · Fixed by #1054
Assignees
Labels
bug Something isn't working priority-high A high priority bug/task in Leo.

Comments

@0rphon
Copy link
Contributor

0rphon commented Jun 16, 2021

🐛 Bug Report

found while testing out #1040. this is correct to fail, but should be caught by leo instead of rust

Code snippet to reproduce

[main]
a: u8 = -2;
function main(a: u8) {}

Stack trace & error message

D:\Work\leo-playground>D:\Work\leo_repos\leo\target\release\leo clean && D:\Work\leo_repos\leo\target\release\leo run
      Done Finished in 0 milliseconds 

     Build Starting...
     Build Compiling main program... ("D:\\Work\\leo-playground\\src/main.leo")
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(FormattedError { line_start: 1, line_stop: 1, col_start: 1, col_stop: 24, path: "D:\\Work\\leo-playground\\src/main.leo", content: "function main(a: u8) {}\r", message: "failed to parse `-2` as expected integer type" })', D:\Work\leo_repos\leo\compiler\src\value\integer\integer.rs:136:32
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Your Environment

  • leo commit 20befbd
  • rustc version 1.55.0-nightly
  • windows 10 build 10.0.19041.630
@0rphon 0rphon added the bug Something isn't working label Jun 16, 2021
@gluax gluax self-assigned this Jun 17, 2021
@gluax gluax added the priority-high A high priority bug/task in Leo. label Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority-high A high priority bug/task in Leo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants