-
Notifications
You must be signed in to change notification settings - Fork 409
fix(print): Print enums #10472
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
Merged
Merged
fix(print): Print enums #10472
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
075af0d
Add integration test
aakoshh d9256b3
Fix the parsing of enums in the print executor
aakoshh 39a5ef9
Test with trailing data and format string
aakoshh 61a3ea2
Only keep the elements we care about
aakoshh 4f643ef
Make the match exchaustive in type
aakoshh 7a64cfe
Use Zero for no fields, rather than Three
aakoshh 093d594
Apply suggestion from @aakoshh
aakoshh dde8c2c
Do not collect into a vector the defaults
aakoshh 82b01b3
Merge branch 'af/9294-print-enum' of github.com:noir-lang/noir into a…
aakoshh 52d5716
Push to vector only if tagged
aakoshh 6380504
Merge branch 'master' into af/9294-print-enum
aakoshh 31a9c5a
Skip the test in Wasm
aakoshh c4d7ef5
Merge branch 'af/9294-print-enum' of github.com:noir-lang/noir into a…
aakoshh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [package] | ||
| name = "regression_9294" | ||
| type = "bin" | ||
| authors = [""] | ||
| compiler_unstable_features = ["enums"] | ||
|
|
||
| [dependencies] |
11 changes: 11 additions & 0 deletions
11
test_programs/execution_success/regression_9294/src/main.nr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| enum Foo { | ||
| One(Field), | ||
| Two(u32, u64), | ||
| Three, | ||
| } | ||
|
|
||
| fn main() { | ||
| let enums: [Foo; 3] = [Foo::One(10), Foo::Two(20, 30), Foo::Three]; | ||
| println((enums, 40)); | ||
| println(f"Hello {enums}!") | ||
| } |
15 changes: 15 additions & 0 deletions
15
...nargo_cli/tests/snapshots/execution_success/regression_9294/execute__tests__expanded.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...g/nargo_cli/tests/snapshots/execution_success/regression_9294/execute__tests__stdout.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.