-
-
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
Put implicit support for evidence from predef types #3508
Conversation
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.
👍 when green.
* value. | ||
*/ | ||
@inline final def toPredef: A <:< B = | ||
substitute[<:<[*, B]](implicitly[B <:< B]) |
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 think this needs the same treatment as above? Something like:
type F[-Z] = Z <:< B
substitute[F](implicitly[B <:< B])
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.
yes, you are right! I got impatient because on my slow machine the tests took too long. I've fixed the tests on 2.12 and 2.13 so I think it will be green now.
Thank you for the review and thanks for considering it for 2.2.0.
Codecov Report
@@ Coverage Diff @@
## master #3508 +/- ##
==========================================
- Coverage 91.75% 91.74% -0.02%
==========================================
Files 383 383
Lines 8406 8418 +12
Branches 232 220 -12
==========================================
+ Hits 7713 7723 +10
- Misses 693 695 +2 |
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.
LGTM thanks Oscar!
close #2569
There is no reason not to create Is and As instances from the predef ones. The changes in 2.13 make this perfectly safe, but nothing in 2.12 (or before) made it unsafe, the types just lacked a substitute method.
This PR improves matters a bit.
I did notice that
Is
is not sealed, butAs
is. In general these two types have a pretty different API considering how similar they are conceptually.I only did a bit, I added
toPredef
to both of them to convert back to predef types.