-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix aop.Select behavior for CloneModuleAsRecord #1993
Merged
Merged
Conversation
This file contains 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
seldridge
previously approved these changes
Jun 29, 2021
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.
Lol wat. That's some interesting behavior...
Nice test case.
I'm going to change the behavior to not return duplicates
I don't want to merge this until #1985 is merged |
Previously, CloneModuleAsRecord clones would result in the same BaseModule object coming up multiple times when using APIs like .instances, .collectDeep, and .getDeep. This was not the intended behavior and can lead to very subtle bugs.
fb73646
to
25a84b5
Compare
seldridge
approved these changes
Jun 29, 2021
This was referenced Jun 30, 2021
mergify bot
added a commit
that referenced
this pull request
Jun 30, 2021
* Restore aop.Select behavior for CloneModuleAsRecord (cherry picked from commit 0531cb5) * Change behavior of aop.Select to not include CloneModuleAsRecord Previously, CloneModuleAsRecord clones would result in the same BaseModule object coming up multiple times when using APIs like .instances, .collectDeep, and .getDeep. This was not the intended behavior and can lead to very subtle bugs. (cherry picked from commit 25a84b5) Co-authored-by: Jack Koenig <koenig@sifive.com>
mergify bot
added a commit
that referenced
this pull request
Jun 30, 2021
* Restore aop.Select behavior for CloneModuleAsRecord (cherry picked from commit 0531cb5) * Change behavior of aop.Select to not include CloneModuleAsRecord Previously, CloneModuleAsRecord clones would result in the same BaseModule object coming up multiple times when using APIs like .instances, .collectDeep, and .getDeep. This was not the intended behavior and can lead to very subtle bugs. (cherry picked from commit 25a84b5) Co-authored-by: Jack Koenig <koenig@sifive.com>
# for free
to join this conversation on GitHub.
Already have an account?
# 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.
It turns out the behavior of
Select
differs from what we discussed in dev today, it actually returns the same module multiple times when you haveCloneModuleAsRecord
clones. Perhaps this isn't what we want, but I decided to add a test (that passed prior to #1974 and failed after it).We could filter out these duplicates, but I wanted to document the behavior and discuss on this PR.
EDIT:
I have pushed another commit that changes this behavior to the intended behavior
Previously, CloneModuleAsRecord clones would result in the same BaseModule object coming up multiple times when using APIs like .instances, .collectDeep, and .getDeep. This was not the intended behavior and can lead to very subtle bugs.
Contributor Checklist
docs/src
?Type of Improvement
API Impact
Fixes
aop.Select
behavior forCloneModuleAsRecord
; duplicates of the cloned module will no longer appear.Backend Code Generation Impact
No impact
Desired Merge Strategy
Release Notes
Fixes
aop.Select
behavior forCloneModuleAsRecord
; duplicates of the cloned module will no longer appear.Reviewer Checklist (only modified by reviewer)
Please Merge
?