-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fixed a bug that overwrote existing self.inherited method definitions. #326
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #326 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 183 190 +7
Branches 88 90 +2
=========================================
+ Hits 183 190 +7 ☔ View full report in Codecov by Sentry. |
lib/memo_wise.rb
Outdated
|
||
module CreateMemoWiseStateOnInherited | ||
def inherited(subclass) | ||
super |
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 know this is how we defined it in the module_eval
, but I'm wondering if there's a reason to keep the super
before the create_memo_wise_state!
here but after it above. If either works, I don't care which we stick with but think it would be nice to be consistent.
Thanks for drafting this, @alpaca-tc ! I'm looking forward to merging this. I'm also wondering if there's a way to do something similar to solve #321—I can't seem to get something working to address that issue but I have the feeling I'm missing something obvious. Any ideas? |
@JacobEvelyn I think that we can either use
is too confusing. |
73b1406
to
30c7e09
Compare
Thanks @alpaca-tc ! Here are the new benchmarks to put into the README for this change:
|
I might be misunderstanding your suggestions but I can't seem to get anything working that resolves the tests added in #321 . |
@JacobEvelyn I put it in code because it makes it easier to communicate. 1. Use
|
There is a hack that dynamically defines self.inherited when memo_wise is called, but there was a bug that did not consider the case where an existing self.inherited existed, so this has been fixed. And I also fixed a bug that defined an `#inherited` method on the instance.
30c7e09
to
98bb62b
Compare
Thanks @alpaca-tc ! I'm merging this PR and I also appreciate the other code examples you shared. ❤️ I'll talk with @ms-ati about what path we want to take and then we'll work on getting a new version out with your fixes. |
After the #324 PR is merged, I will publish this PR.
Before merging:
README.md
and update this PRCHANGELOG.md
, add an entry following Keep a Changelog guidelines with semantic versioning