Skip to content
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

Implemented very silly workaround for #807 #849

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

djspiewak
Copy link
Member

Would also appreciate a look from @neko-kai. I think this works around the issue. It's a little annoying, but I wasn't able to find anything more elegant, and the nice thing is that it doesn't touch binary compatibility. I believe it should also be fully source-compatible with all existing call-sites that weren't already broken.

Fixes #807 (I think)

@djspiewak djspiewak requested a review from SystemFw April 29, 2020 04:17
@@ -169,8 +169,8 @@ sealed abstract class Resource[+F[_], +A] {
*
**/
def parZip[G[x] >: F[x]: Sync: Parallel, B](
that: Resource[G, B]
): Resource[G, (A, B)] = {
that: Resource[G[?], B]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this one is necessary, btw.

@neko-kai
Copy link

Seems like it works 🤷

@SystemFw
Copy link
Contributor

Could you explain what it does, I'm slightly at a loss :)

@djspiewak
Copy link
Member Author

@SystemFw It seems like, when it comes to variant constructors, F and [x]F[x] are not entirely equal inside of scalac. So what my workaround does is I replaced F with [x]F[x] in the type signatures. This is invisible 99.9% of the time, but in this case it appears to entirely fix the inference.

@SystemFw
Copy link
Contributor

SystemFw commented Apr 29, 2020 via email

@djspiewak
Copy link
Member Author

@SystemFw I was going to implement that change across the whole project soon. For now, I just went with what was already there.

@SystemFw
Copy link
Contributor

SystemFw commented Apr 29, 2020 via email

@djspiewak djspiewak merged commit c2fb504 into typelevel:master Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Significant change in Resource's map/flatMap type with regards to variance
4 participants