-
Notifications
You must be signed in to change notification settings - Fork 224
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
Compiler should not panic when an oracle is called from constrained method #4565
Comments
Thanks for highlighting this! This can be done with similar logic used to prevent passing slices to unconstrained functions from constrained ones. noir/compiler/noirc_frontend/src/hir/type_check/expr.rs Lines 186 to 195 in a8b7cdb
|
@TomAFrench we should probably generalize that check to error for all types that are invalid to pass from unconstrained to constrained. Such as references. |
…onstrained to constrained functions (#4570) # Description Added compiler errors for when a oracle or reference is passed from a unconstrained to a constrained function. ## Problem\* Currently the compiler panics when you pass a reference or an oracle from a unconstrained to constrained function. Resolves #4565 Closes 4565 ## Summary\* A compiler error has been added for each condition with an appropriate message to aid the user. ## Documentation\* Check one: - [X ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ X] I have tested the changes locally. - [ X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Maxim Vezenov <mvezenov@gmail.com>
Aim
Get compilation error instead of compiler panic
Expected Behavior
compilation error
Bug
The application panicked (crashed).
Message: internal error: entered unreachable code: All
oracle
methods should be wrapped in an unconstrained fnLocation: compiler/noirc_evaluator/src/ssa/acir_gen/mod.rs:615
To Reproduce
Project Impact
None
Impact Context
No response
Workaround
Yes
Workaround Description
Just don't do it ;)
Additional Context
No response
Installation Method
None
Nargo Version
noirc version = 0.25.0+3ad88696ab63d8b1838b4ca7e9a3a97f823ca976
NoirJS Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: