-
Notifications
You must be signed in to change notification settings - Fork 36
Fix cross module constants and comprehension scoping #526
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
base: next
Are you sure you want to change the base?
Fix cross module constants and comprehension scoping #526
Conversation
…d MIR translation
Soulthym
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Al-Kindi-0, I left a few comments below about clarifications and a minor nit regarding Boxing RangeExpr. The code itself looks good to me otherwise, great job!
| let current_item_node_index = self.get_node_index_or_add(¤t_item); | ||
| for (referenced_item, ref_type) in self.referenced.clone().iter() { | ||
| let referenced_item_node_index = self.get_node_index_or_add(referenced_item); | ||
| self.deps_graph.add_edge( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this is the part of the issue you encountered, we were overriding values without checking for their existence first?
This edit looks correct, just asking to confirm I understand the problem properly
| Default, | ||
| /// Access binds a sub-slice of a vector | ||
| Slice(RangeExpr), | ||
| Slice(Box<RangeExpr>), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to switching to a Box here instead of an owned RangeExpr?
Describe your changes
This PR fixes two bugs related to cross-module imports and comprehension scoping:
Cross-module constant dependencies:
Constants used in comprehension iterables fail when imported across module boundaries.
Comprehension periodic binding scoping:
Iterating over a vector containing periodic column references causes the binding to be mistyped as PeriodicColumn, leading to "no entry found for key" panic.
Checklist before requesting a review
nextaccording to naming convention.CHANGELOG.md