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

Generator sample can return None which lead to nasty exception #279

Open
rpiotrow opened this issue May 11, 2023 · 0 comments
Open

Generator sample can return None which lead to nasty exception #279

rpiotrow opened this issue May 11, 2023 · 0 comments

Comments

@rpiotrow
Copy link
Contributor

In https://github.com/theiterators/kebs/blob/master/scalacheck/src/main/scala/pl/iterators/kebs/scalacheck/Generators.scala#L8 use of .sample can lead to java.util.NoSuchElementException: None.get.

One case when this can happen is usage of custom generator which uses suchThat in its implementation (see: https://github.com/typelevel/scalacheck/blob/main/core/shared/src/main/scala/org/scalacheck/Gen.scala#L291-L296)

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

No branches or pull requests

1 participant