-
Notifications
You must be signed in to change notification settings - Fork 199
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(errors): Refactor errors representation in compiler #2760
chore(errors): Refactor errors representation in compiler #2760
Conversation
@jfecher Welcome back :) |
I've skimmed over the code and it seems reasonable. Can you elaborate more on the motivations for this PR though?
What are some examples of unit tests we'd like to write here?
How so? I would think errors from sub modules are already propagated since they wouldn't be displayed at all otherwise. Is this a separate bug? |
Allow propagation of parsing errors from sub-modules -> I can't recall where I encountered this, so ignore it for now. Sorry! Allow to write an unit test that checks for specific compilation error
In the old testing system, we only check if the test fails compilation, not HOW it fails to compile. This actually hide some bugs in both test code & production code. For example: in
If we judge by the file name it should fail because there is wrong number of parameters. Last time I checked it actually fails because An other problem I saw is in this example:
this tests uses After this changes are merged into the |
4a1a4eb
to
fe4cdda
Compare
fe4cdda
to
a7ef0e7
Compare
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 don't want to block this anymore, but eventually we should reconsider storing the errors in a tuple of (error, file). As it is now there are a lot more calls to extend
which obscure the happy path of the code more.
6ac6d81
to
cffbb9e
Compare
@jfecher |
* master: (28 commits) chore: add `CRS` directory to gitignore (#2852) chore: add initial version of `Backend` interface for `noir_js` (#2851) chore(errors): Refactor errors representation in compiler (#2760) chore(ci): run `noir_js` tests in CI (#2843) chore(noir_js)!: Rename inner and outer proof methods (#2845) chore: remove unnecessary `AcirValue`s (#2823) fix: Conditionally run the "Create or Update PR" step in acir artifacts rebuild workflow (#2849) fix: lack of cjs package version (#2848) chore: delete unnecessary nix files (#2840) chore!: `generateWitness` now returns a serialized witness file (#2842) chore: fix `acvm_js` linting and tests (#2834) feat: remove redundant predicate from brillig quotients (#2784) chore: Fix dependencies in acvm_js and remove local lock file (#2833) chore: add acvm_js to integration build chore: update discord link (#2831) chore: discard changes in nargo directory chore: Update ACIR artifacts (#2810) chore: yarn install chore: Remove acvm tracking workflow (#2829) add acvm_js to workspace ...
* master: (40 commits) chore(noir): Release (master) (#2859) chore: remove rebuild script since its failing chore(ci): rename CI workflows based on theme (#2853) chore(noir): Release (master) (#2827) chore: add solidity verifier workflow (#2749) chore: add `CRS` directory to gitignore (#2852) chore: add initial version of `Backend` interface for `noir_js` (#2851) chore(errors): Refactor errors representation in compiler (#2760) chore(ci): run `noir_js` tests in CI (#2843) chore(noir_js)!: Rename inner and outer proof methods (#2845) chore: remove unnecessary `AcirValue`s (#2823) fix: Conditionally run the "Create or Update PR" step in acir artifacts rebuild workflow (#2849) fix: lack of cjs package version (#2848) chore: delete unnecessary nix files (#2840) chore!: `generateWitness` now returns a serialized witness file (#2842) chore: fix `acvm_js` linting and tests (#2834) feat: remove redundant predicate from brillig quotients (#2784) chore: Fix dependencies in acvm_js and remove local lock file (#2833) chore: add acvm_js to integration build chore: update discord link (#2831) ...
* master: (107 commits) chore: remove leftover files from `acvm-repo` (#2861) chore: miscellaneous ACVM fixups (#2864) chore(noir): Release (master) (#2875) fix: Remove cast for field comparisons in brillig (#2874) fix: remove duplication of code to load stdlib files (#2868) chore(noir_js): remove unnecessary input validation in JS (#2841) chore: build yarn packages in parallel (#2867) chore(ci): remove `toml2json` dependency (#2862) chore: fix infinite loop in yarn workspace cleaning (#2863) chore(noir): Release (master) (#2859) chore: remove rebuild script since its failing chore(ci): rename CI workflows based on theme (#2853) chore(noir): Release (master) (#2827) chore: add solidity verifier workflow (#2749) chore: add `CRS` directory to gitignore (#2852) chore: add initial version of `Backend` interface for `noir_js` (#2851) chore(errors): Refactor errors representation in compiler (#2760) chore(ci): run `noir_js` tests in CI (#2843) chore(noir_js)!: Rename inner and outer proof methods (#2845) chore: remove unnecessary `AcirValue`s (#2823) ...
…2760) Co-authored-by: Yordan Madzhunkov <ymadzhunkov@gmail.com>
Summary*
Refactoring DefCollector to return CompilationErrors
Problem*
The motivation for this changes are:
The refactoring of the test will be in next code review, to keep this one as short as possible
PR Checklist*
cargo fmt
on default settings.