-
Notifications
You must be signed in to change notification settings - Fork 8
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
Generic generators #78
base: master
Are you sure you want to change the base?
Conversation
.github/workflows/dotnet-core.yml
Outdated
with: | ||
dotnet-version: 6.0.201 | ||
dotnet-version: 8 |
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.
Why did you change the .NET version?
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.
@TysonMN
Because .NET 6 reached Out Of Support last year (in November, if I remember correctly).
.NET 8 is the next LTS which is supported until the end of 2026.
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.
So it wasn't needed to add this feature then?
If not, then please make a separate PR with a single commit that upgrades .NET. In the commit message body, put the explanation that you have given here.
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.
I can check, but I believe that it won't compile under .NET 6.
I can make a PR so we can upgrade to .NET 8 first, and then rebase this one on top.
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.
I mean, .NET 8 is needed for the feature the way it is now.
I just decided not to take any extra effort to add .NET 6 workarounds and simply use the officially supported version.
This way we can say that it is needed to add the feature.
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.
I can make a PR so we can upgrade to .NET 8 first, and then rebase this one on top.
Yes. Two PRs in that order would be good.
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.
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.
@TysonMN As discussed, I have rebased this branch on top of .NET 8 enabled master
.
Please check again.
ded2bca
to
062871c
Compare
This PR adds the ability to register custom generators for generic type.
It is the main reason FSCheck is used alongside with Hedgehog as a "fallback" solution in my company: we use a lot of generic data structures, mostly written in C#.
Having the ability to register generators for custom generic types simplified writing tests a lot.
To register a generator for a generic type we can now:
FSharp:
CSharp:
And then these generators can be registered using
addGenerators<'a>
function:FSharp:
CSharp:
Ref: #77