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

chore: force public functions for trait implementation #3986

Merged
merged 7 commits into from
Jan 11, 2024

Conversation

Thunkar
Copy link
Contributor

@Thunkar Thunkar commented Jan 9, 2024

Resolves #3948

Functions implemented in Traits weren't being treated as public, which resulted in ...is private and not visible from the current module warnings

This PR simply forces the creation of public functions in the AST at the parser level.

@Thunkar Thunkar self-assigned this Jan 9, 2024
@Thunkar Thunkar changed the title force public functions for trait implementation chore: force public functions for trait implementation Jan 9, 2024
@Thunkar
Copy link
Contributor Author

Thunkar commented Jan 9, 2024

Is it worth it to add another flag to the function_definition parser and disallow modifiers for trait implementations?

Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

Looks good. Can you add a warning if the impl method had any modifiers passed which explains that they have no effect?

@Thunkar Thunkar requested a review from jfecher January 10, 2024 09:17
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

compiler/noirc_frontend/src/parser/errors.rs Outdated Show resolved Hide resolved
compiler/noirc_frontend/src/parser/parser.rs Outdated Show resolved Hide resolved
@jfecher jfecher enabled auto-merge January 10, 2024 17:59
@jfecher jfecher added this pull request to the merge queue Jan 11, 2024
Merged via the queue into master with commit e37798c Jan 11, 2024
30 checks passed
@jfecher jfecher deleted the gj/force_public_trait_impl_fn branch January 11, 2024 10:04
TomAFrench added a commit that referenced this pull request Jan 11, 2024
* master:
  chore: quiet down aztec-bot! (#4006)
  chore: force public functions for trait implementation (#3986)
  feat: docker testing flow (#3895)
  feat: decompose `Instruction::Constrain` into multiple more basic constraints (#3892)
  feat: remove truncation from brillig casts (#3997)
  chore: add test case showing reexports (#4001)
TomAFrench added a commit that referenced this pull request Jan 11, 2024
* master:
  chore(ci): disable commit comments on docs publishing (#3998)
  feat: simplify chains of casts to be all in terms of the original `ValueId` (#3984)
  chore: quiet down aztec-bot! (#4006)
  chore: force public functions for trait implementation (#3986)
  feat: docker testing flow (#3895)
  feat: decompose `Instruction::Constrain` into multiple more basic constraints (#3892)
  feat: remove truncation from brillig casts (#3997)
  chore: add test case showing reexports (#4001)
  feat: remove truncations which can be seen to be noops using type information (#3953)
  chore: remove homemade keccakf1600 implementation (#3996)
TomAFrench added a commit that referenced this pull request Jan 11, 2024
* master:
  chore(docs): devcontainer docs (#4007)
  chore(ci): disable commit comments on docs publishing (#3998)
  feat: simplify chains of casts to be all in terms of the original `ValueId` (#3984)
  chore: quiet down aztec-bot! (#4006)
  chore: force public functions for trait implementation (#3986)
TomAFrench added a commit that referenced this pull request Jan 12, 2024
* master: (285 commits)
  feat: Add `assert_max_bit_size` method to `Field` (#4016)
  fix: fixup exports from `noir_wasm` (#4022)
  chore(ci): fix docker CI (#4014)
  feat(lsp): goto trait method declaration (#3991)
  chore: add action to check for dead links (#3992)
  chore: improve cspell setup (#3985)
  feat: Add dependency resolver for `noir_wasm` and implement `FileManager` for consistency with native interface (#3891)
  chore(docs): devcontainer docs (#4007)
  chore(ci): disable commit comments on docs publishing (#3998)
  feat: simplify chains of casts to be all in terms of the original `ValueId` (#3984)
  chore: quiet down aztec-bot! (#4006)
  chore: force public functions for trait implementation (#3986)
  feat: docker testing flow (#3895)
  feat: decompose `Instruction::Constrain` into multiple more basic constraints (#3892)
  feat: remove truncation from brillig casts (#3997)
  chore: add test case showing reexports (#4001)
  feat: remove truncations which can be seen to be noops using type information (#3953)
  chore: remove homemade keccakf1600 implementation (#3996)
  feat!: Breaking changes from aztec-packages (#3955)
  chore(docs): small grammar fix on the landing page (#3989)
  ...
github-merge-queue bot pushed a commit that referenced this pull request Jan 12, 2024
…4023)

# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

This PR fixes the warnings which have been caused by #3986 

## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Methods from implementing traits should be visible
3 participants