Skip to content

No panic on symbol lookup fail #5555

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

Closed

Conversation

arihant2math
Copy link
Collaborator

No description provided.

@@ -33,6 +33,7 @@ pub enum CodegenErrorType {
DuplicateStore(String),
InvalidMatchCase,
NotImplementedYet, // RustPython marker for unimplemented features
SymbolLookupError { symbol: String },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this is not a user-side Python error but our own RustPython implementation bug, let's not expose it here.

@coolreader18
Copy link
Member

Do you have a repr for this getting triggered? The reason it's a panic is because this shouldn't ever happen, the symboltable should be populated with every identifier present in the source file even if it would be a NameError at runtime. It should really be an unreachable!(), not a panic!().

@arihant2math
Copy link
Collaborator Author

arihant2math commented Feb 25, 2025

Makes sense, this occurs because I implemented match statements poorly. I feel like the instruction set to be upgraded to 3.12 before match statements are attempted so there is a better feel for specialized instructions. I'll get an minimal example that triggers this working soon.

@arihant2math
Copy link
Collaborator Author

arihant2math commented Feb 25, 2025

Interestingly enough #5494 runs into this as well for unrelated reasons.

@arihant2math arihant2math marked this pull request as draft February 25, 2025 02:36
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
@arihant2math arihant2math force-pushed the compile-name-no-panic branch from 98c8b40 to aeb9715 Compare March 3, 2025 05:40
@arihant2math
Copy link
Collaborator Author

I have found a superior solution

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.

3 participants