-
Notifications
You must be signed in to change notification settings - Fork 200
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
Allow importing definitions from parent module using super
.
#4835
Comments
github-merge-queue bot
pushed a commit
that referenced
this issue
Apr 18, 2024
# Description ## Problem\* ## Summary\* This PR reserves the keyword `super` in prep for #4835 ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ ] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings.
This would be awesome. Also - being able to do |
5 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Jul 15, 2024
# Description ## Problem Resolves #4835 ## Summary Implements `super` in `use` statements and regular paths. For example: ```rust fn some_function() {} mod foo { use super::some_function(); // used in a `use` fn another_function() { super::some_function(); // used in a path } fn foo() { some_function(); // of course this also works because of the `use` above } } ``` Note that, unlike Rust, only one `super` is allowed: `super::super::...` will give an error. ## Additional Context None. ## Documentation\* Check one: - [ ] No documentation needed. - [x] 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rust has the concept of super which allows importing from the parent module. Noir doesn't have this so all imports from non-descendant modules within the same crate must specify a full
crate::
import.This is especially useful for when writing tests and grouping them within a submodule
The text was updated successfully, but these errors were encountered: