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

Backport #2772 add foldRightDefer to Foldable #3338

Conversation

gagandeepkalra
Copy link
Contributor

addresses #3143

@gagandeepkalra
Copy link
Contributor Author

java.lang.RuntimeException: Cats laws: Binary compatibility check failed!

I see other laws added without care for BC, did we add this constraint recently?

It's gonna be tricky to follow through with this.

@travisbrown
Copy link
Contributor

travisbrown commented Mar 5, 2020

We've always guaranteed (and checked) bincompat within 2.x for laws on mainline, and I think we should on the 2.11 branch as well (note that this kind of addition only breaks bincompat on 2.11).

My vote would be just not to include the consistency law on this branch, possibly adding a comment to the method along the lines of "Implementers are responsible for ensuring they maintain consistency with foldRight; this is not checked by laws on Scala 2.11".

@codecov-io
Copy link

codecov-io commented Mar 6, 2020

Codecov Report

Merging #3338 into scala_2.11 will decrease coverage by 0.02%.
The diff coverage is 50%.

Impacted file tree graph

@@              Coverage Diff               @@
##           scala_2.11    #3338      +/-   ##
==============================================
- Coverage       93.46%   93.44%   -0.03%     
==============================================
  Files             385      385              
  Lines            7162     7166       +4     
  Branches          197      186      -11     
==============================================
+ Hits             6694     6696       +2     
- Misses            468      470       +2
Impacted Files Coverage Δ
core/src/main/scala/cats/Foldable.scala 98.07% <0%> (-1.93%) ⬇️
core/src/main/scala/cats/syntax/foldable.scala 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29efba5...a2e715c. Read the comment docs.

@gagandeepkalra
Copy link
Contributor Author

@travisbrown Think I'm a little confused, I see this added in May yet no BC problem.

Screenshot 2020-03-06 at 10 06 33 PM

yes, adding foldRightDefer would only break BC on 2.11, but how was the above law added given it is part of 2.11.

@travisbrown
Copy link
Contributor

@gagandeepkalra See @kailuowang's comment on #2817:

BTW, strictly speaking this is breaking change for UnorderedFoldableLaws but it's unlikely to affect anyone and we are breaking BC in cats-laws in our next release.

And mine above:

We've always guaranteed (and checked) bincompat within 2.x for laws on mainline

That addition was first included in 2.0.0, so while it was a breaking change since 1.x on Scala 2.11, we'd decided that that was okay for cats-laws (we only guaranteed 100% bincompat across 1.x and 2.x for cats-core, etc.).

@gagandeepkalra
Copy link
Contributor Author

I see, thank you. Apologies for not checking the PR first 😔

@travisbrown
Copy link
Contributor

No worries, glad that helped!

@gagandeepkalra gagandeepkalra changed the title Backported #2772 add foldRightDefer to Foldable Backport #2772 add foldRightDefer to Foldable Mar 8, 2020
@travisbrown travisbrown self-requested a review March 10, 2020 08:10
Copy link
Contributor

@travisbrown travisbrown left a comment

Choose a reason for hiding this comment

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

Thanks!

@travisbrown travisbrown merged commit 190981c into typelevel:scala_2.11 Mar 11, 2020
@gagandeepkalra gagandeepkalra deleted the backport/foldable/foldRightDefer branch March 11, 2020 15:07
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.

3 participants