Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR allows FsCheck to shrink values of unions with private constructors, making the behavior for unions with private constructors consistent with that for records with private constructors.
FsCheck could already derive generators for records and unions with private constructors (for unions, this functionality was added in PR #186). It could also shrink values of records with a private constructor, but not values of unions with a private constructor. Several people have run into that, see issues #401, #436 and #525.
Whether automatically deriving generators and shrinkers for types with a private constructor should be done in general is something that could be discussed (this is also touched upon in issue #436), but since FsCheck already does generator derivation for such types and also does shrinker derivation for such record types, I believe being consistent for such union types is important enough to warrant this PR regardless of said discussion.