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

fix: Don't panic when checking if an undeclared variable is mutable #1987

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jul 20, 2023

Description

Problem*

Resolves #1985

Summary*

We were trying to grab the definition of a variable that wasn't defined previously, leading to a compiler panic. I've added a try_definition function to avoid this and went through and removed any other usage of the panicking definition method from name resolution and type inference.

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@jfecher jfecher added this pull request to the merge queue Jul 20, 2023
Merged via the queue into master with commit 0449518 Jul 20, 2023
@jfecher jfecher deleted the jf/fix-name-resolution-panic branch July 20, 2023 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler panics when trying to create a mutable reference of an undefined variable
2 participants