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

add parTraverseN and parSequenceN #498

Merged
merged 4 commits into from
Jun 11, 2019

Conversation

sideeffffect
Copy link

@sideeffffect sideeffffect commented Mar 21, 2019

@sideeffffect
Copy link
Author

Is there a way to work around the issue

[error]  * abstract method catsEffectSyntaxAsyncObj(cats.effect.Async)cats.effect.Async in trait cats.effect.syntax.AsyncSyntax is inherited by class AllCatsEffectSyntax in current version.
[error]    filter with: ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("cats.effect.syntax.AllCatsEffectSyntax.catsEffectSyntaxAsyncObj")
[error]  * abstract method toAsyncOps(java.lang.Object,cats.effect.Async)cats.effect.Async#Ops in trait cats.effect.Async#ToAsyncOps is inherited by class AllCatsEffectSyntax in current version.
[error]    filter with: ProblemFilters.exclude[InheritedNewAbstractMethodProblem]("cats.effect.syntax.AllCatsEffectSyntax.toAsyncOps")
[error] java.lang.RuntimeException: cats-effect: Binary compatibility check failed!

that happens only with Scala 2.11?

@sideeffffect
Copy link
Author

@SystemFw any tips for solving the problem with Scala 2.11?

@djspiewak
Copy link
Member

@sideeffffect It can't really be resolved on Scala 2.11. What you're doing here is you're adding functions to a trait (AllCatsEffectSyntax) which previously existed. Anyone inheriting from that trait is going to get that function. The problem with this is that, in Scala 2.11 (or more specifically, prior to Java 8), traits were encoded through explicit function delegation to a nested class (which contained the definition) in the implementing subtypes. This is problematic because the implementing subtypes cannot delegate to the nested class on these new functions (such as parTraverseN) since it didn't exist when they were compiled! (since they were compiled against previous versions of cats-effect) So any code which calls parTraverseN would then get an AbstractMethodError. This is what MiMa is detecting.

You basically cannot add syntax like this in the 1.x timeline. Or rather, you could add AsyncSyntax, but you can't add it to the main trait. The good news is that 2.x is right around the corner. The bad news is we really don't want to change too much, so I'm not sure if there's time for this to make it.

@rossabaker
Copy link
Member

Is it any worse for compatibility than the changes proposed in #262?

@djspiewak
Copy link
Member

djspiewak commented May 3, 2019

@rossabaker Do you mean #519? Broadly-speaking no, it should be about the same if I fully comprehend both PRs. I would definitely be comfortable with both making it.

@djspiewak
Copy link
Member

@sideeffffect I would recommend waiting for #546 to land (which flushes out mima), then merge with master (please don't rebase open PRs) and see if that resolves the issues.

@djspiewak djspiewak added this to the 2.0 milestone May 26, 2019
@djspiewak
Copy link
Member

@sideeffffect Any update on this? We're going to be in compatibility-freeze very shortly.

@sideeffffect
Copy link
Author

@djspiewak rebased on the newest master
OK to merge?

@codecov-io
Copy link

codecov-io commented Jun 9, 2019

Codecov Report

Merging #498 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #498      +/-   ##
==========================================
- Coverage   89.09%   89.05%   -0.05%     
==========================================
  Files          73       75       +2     
  Lines        2119     2137      +18     
  Branches      129      125       -4     
==========================================
+ Hits         1888     1903      +15     
- Misses        231      234       +3

@djspiewak
Copy link
Member

@sideeffffect Reminder: as I said, do not rebase PRs. It's in the contributing guidelines and everything. :-)

I'll take a final look at things and merge (hopefully later today). Thanks for all your work!

@sideeffffect
Copy link
Author

sideeffffect commented Jun 10, 2019

@djspiewak facepalm sorry, I totally missed that 😄 I'll pay better attention next time
thanks for looking at it!

@djspiewak djspiewak merged commit 0609e51 into typelevel:master Jun 11, 2019
rossabaker pushed a commit to rossabaker/cats-effect that referenced this pull request Jul 30, 2019
rossabaker pushed a commit to rossabaker/cats-effect that referenced this pull request Jul 30, 2019
rossabaker pushed a commit to rossabaker/cats-effect that referenced this pull request Jul 30, 2019
@sideeffffect sideeffffect deleted the add-parTraverseN branch September 22, 2022 12:33
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.

5 participants