-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
improve interaction with subtyping in OptionOps#liftTo #2480
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2480 +/- ##
=======================================
Coverage 95.38% 95.38%
=======================================
Files 357 357
Lines 6517 6517
Branches 279 282 +3
=======================================
Hits 6216 6216
Misses 301 301
Continue to review full report at Codecov.
|
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.
This is nice. Would you add a doctest to verify the new ergonomics?
Also the liftTo on Either can be improved the same way right? |
Thanks! BTW, in case you haven't used doctest before, here is an example of PR adding doctests, it would nice to have test make sure that this new interaction works as intended. |
I added the same change to EitherOps#liftTo. I also added doctests. The latter turned out to be a PITA. I added the doctests, and they compiled and ran. In order to see whether they actually exercise my new code, I changed the Oh well, one more scala war story to tell. |
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.
Looks great, thank you!
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.
This is nice. Thanks!
I've simplified the tests a bit. The reason I used |
@kailuowang @LukaJCB could you approve again? |
This PR was approved and all review comments were addressed, so to me it looks like it's ready to be merged. Is there anything else to do to get this merged? |
Sorry for the delay, merging now :) |
Cool, thanks! |
Currently OptionOps#liftTo interacts badly with subtyping. Something like this won't compile:
One needs to write this instead:
This patch fixes this.