-
Notifications
You must be signed in to change notification settings - Fork 204
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
feat: Basic implementation of traits #2368
feat: Basic implementation of traits #2368
Conversation
@jfecher Have a nice weekend :) |
crates/nargo_cli/tests/compile_failure/trait_wrong_parameters_count/src/main.nr
Show resolved
Hide resolved
crates/nargo_cli/tests/compile_failure/trait_not_exists/Nargo.toml
Outdated
Show resolved
Hide resolved
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.
Just a few more small suggestions
crates/nargo_cli/tests/compile_failure/trait_wrong_parameters_count/src/main.nr
Show resolved
Hide resolved
Looks like you've got some import errors |
db2be73
to
675708a
Compare
Converted the traits-related tests that are supposed to fail, to the proper format (nargo packages) in the crates/nargo_cli/tests/compile_failure directory. This ensures that the tests are now executed when 'cargo test' is run.
convert to `from_func_return_type` to struct method. Definitely a better approach. Co-authored-by: jfecher <[email protected]>
clean up Co-authored-by: jfecher <[email protected]>
13ed272
to
05b5208
Compare
Does this close #527? |
@yordanmadzhunkov would you like to take a jab at documenting this PR? #3193 |
Sure, we will document traits, but for now I prefer to focus on testing/bug fixing, before documentation. |
* master: chore: update ACIR artifacts (#2503) chore!: Update to `acvm-backend-barretenberg` v0.12.0 (#2377) fix: Bring back accidentally deleted double_verify_proof test. (#2501) chore(aztec_noir): import aztec library if not found yet (#2492) chore(abi)!: Replace struct name with fully qualified struct path (#2374) chore!: Remove keys from preprocessed artifacts (#2283) chore(noir): Release 0.10.5 (#2482) feat: Basic implementation of traits (#2368) fix: Implement constant folding during the mem2reg pass (#2464)
@Savio-Sou we're avoiding documenting traits until they're complete. We don't want users to be thinking they're in the language yet. There's also a compiler warning when using them to alert users they're still in development. This PR is just one in a series since traits are a large feature we need to break up into many PRs. |
@Savio-Sou I believe @yordanmadzhunkov and his team is currently working on such a list. |
@yordanmadzhunkov I'm documenting traits in the Noir docs. Will add you as a reviewer if you don't mind! |
@signorecello |
Description
Make the most basic test case for traits execute correctly. Although this review looks big, it's mostly test code.
Next step will be to refactor tests in resolver, so I can add more unit tests and move the errors from Def Collecter to Resolver.
PR Checklist*
cargo fmt
on default settings.After this PR this noir programs work:
Execution of specialized for the specific type:
Execution of trait provided default implementation
For more examples refer to tests added in this PR