-
Notifications
You must be signed in to change notification settings - Fork 244
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
comptime interpreter handles scopes incorrectly when calling builtin/foreign/oracle functions #5274
Comments
Actually, this seems to be specific to |
@TomAFrench It is also because of the fact that any time a variable is not in scope the interpreter assumes the variable is not comptime. I'm not sure why it'd be happening here but we should probably make that error more general. |
I've fixed this issue in #5276. We were performing an early return in the situation where we hit a builtin/foreign/oracle function so we missed the call to |
@TomAFrench Thanks, I was about to say I had this fixed as well yesterday but it looks like I never made the PR. We found the same issue though. |
# Description ## Problem\* Resolves #5274 ## Summary\* This PR implements the `as_slice` builtin function for the comptime interpreter. I've also fixed an issue where due to builtin/foreign/oracle functions having an early return, we don't call `exit_function` which results in the scopes being left in an inconsistent state. ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** 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.
The below program compiles just fine
however if I change the assertion to act on
ws
rather thanws_as_slice
then the program fails to compile with the error message below.The text was updated successfully, but these errors were encountered: