-
Notifications
You must be signed in to change notification settings - Fork 623
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
Address nullability issue with Arb.edgecase #4029
Milestone
Comments
Is this a good use case for Kotlin's own https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-result/ |
Arb interface already uses
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
An
Arb<T>
, whereT
is nullable currently has no way of expressing the null edgecase, since returning null fromArb.edgecase
is interpreted as "no edgecase exists" by the property testing framework.Suggestion
Change
Arb<T>.edgecase(rs: RandomSource): T?
toArb<T>.edgecase(rs: RandomSource): Sample<T>?
. Returning null can still be interpreted as no edgecase exists. Sample lets us box the null edgecase so it can be represented as well.Reference
The text was updated successfully, but these errors were encountered: