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

Fix retrying code in doPureApply. #316

Merged
merged 1 commit into from
Mar 13, 2017

Conversation

sellout
Copy link

@sellout sellout commented Feb 27, 2017

(Backport of #301.)

This commit fixes a bug pointed out by @alexarchambault. When
constructing an A => B value from Cogen[A] and Gen[B], we need
to be able to reliably generate a B value given a Seed. The
doPureApply method was given the ability to retry -- but
unfortunately, it used the same result value (with the same seed)
instead of trying a new one, defeating the retry code.

This commit fixes that problem. It adds tests to ensure that filtered
generators that can also produce real values can be used with
Gen.function1. (If a generator can never produce values it will still
be a problem.)

Fixes #300.

@sellout
Copy link
Author

sellout commented Feb 28, 2017

So, 1. that binary compatibility check is really cool, but 2. how did this change break it? 😢

@xuwei-k
Copy link
Contributor

xuwei-k commented Feb 28, 2017

I think we should update mima to latest version (0.1.14). Mima 0.1.9 does not support Scala 2.12 and there are some bugs.

@xuwei-k
Copy link
Contributor

xuwei-k commented Mar 13, 2017

There are some problems 😧 #319 #318

@rickynils
Copy link
Contributor

@sellout Can you rebase this PR against 1.13.x? The binary compatibility issue should hopefully have been fixed now (#318)

This commit fixes a bug pointed out by @alexarchambault. When
constructing an `A => B` value from `Cogen[A]` and `Gen[B]`, we need
to be able to reliably generate a `B` value given a `Seed`. The
`doPureApply` method was given the ability to retry -- but
unfortunately, it used the same result value (with the same seed)
instead of trying a new one, defeating the retry code.

This commit fixes that problem. It adds tests to ensure that filtered
generators that can also produce real values can be used with
Gen.function1. (If a generator can never produce values it will still
be a problem.)

Fixes typelevel#300.
@sellout sellout force-pushed the fix-retry-in-function-gen branch from a0e9dfc to ab40859 Compare March 13, 2017 14:30
@sellout
Copy link
Author

sellout commented Mar 13, 2017

Rebased and looks good. Thanks.

@rickynils rickynils merged commit e0478fd into typelevel:1.13.x Mar 13, 2017
@sellout
Copy link
Author

sellout commented Mar 14, 2017

@rickynils Thanks – any chance of a 1.13.6 release with this in it? It’ll allow us to get off a 1.14 SNAPSHOT that makes dealing with conflicting dependencies a pain.

@EncodePanda
Copy link

@rickynils could we please release 1.13.6 ?

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