feat(traits): Add default and override of methods#2585
Merged
jfecher merged 1 commit intonoir-lang:masterfrom Sep 7, 2023
Merged
feat(traits): Add default and override of methods#2585jfecher merged 1 commit intonoir-lang:masterfrom
jfecher merged 1 commit intonoir-lang:masterfrom
Conversation
This commit removes some checks on UnresolvedTypes.
It adds the following validity checks and tests for them:
Duplicate trait blocks should not compile
Duplicate trait impl blocks should not compile
Duplicate method definitions in impl blocks should not compile
Impl blocks invalid types should not compile
12 tasks
Contributor
Author
|
@jfecher :) |
jfecher
approved these changes
Sep 7, 2023
Contributor
jfecher
left a comment
There was a problem hiding this comment.
There's a few items here that can be cleaned up (see comments), but we can leave those to a future PR. I'll be on vacation until Monday the 18th starting tomorrow so I'd like to approve this now to get it merged.
While I'm gone, feel free to keep making PRs. You can set the merge target of each successive PR to the branch in the previous PR so that you can keep building on the code even if the prior PR(s) aren't yet merged. Might have some merge conflicts when changes are made to an earlier PR later but I think this would be better than halting all progress for a week. Apologies, I know this is suboptimal!
crates/nargo_cli/tests/compile_failure/dup_trait_implementation_3/src/main.nr
Show resolved
Hide resolved
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is the first part from split #2574
#Description #2568
In this PR we introduce the following progress of implementation of traits:
Remove unnecessary checks:
Name resolution/Type checking:
Successful examples:
trait_default_implementationtrait_override_implementationPR Checklist*
cargo fmton default settings.