-
Notifications
You must be signed in to change notification settings - Fork 532
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 "repeated asyncF evaluation not memoized" law #473
Conversation
Codecov Report
@@ Coverage Diff @@
## master #473 +/- ##
==========================================
+ Coverage 89.6% 89.66% +0.06%
==========================================
Files 70 70
Lines 2020 2032 +12
Branches 202 197 -5
==========================================
+ Hits 1810 1822 +12
Misses 210 210 |
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.
Note that this law probably breaks binary compatibility for Scala 2.11.
We can live with it for laws, but I'm not seeing Mima rules.
MiMa after enabling it in laws:
Is it fine if I add all of them to exclusions? |
I thought it would be reasonable to check that.
It's easy to break this law, for example by removing the
suspend
call here: https://github.com/kubukoz/slick-effect/blob/3af6c4ab8950f42ebbcaaed0fc5621c503bb258a/src/main/scala/slickeffect/DBIOAsync.scala#L27. That would memoize the promise, and it would only be completed once.