-
Notifications
You must be signed in to change notification settings - Fork 407
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
Deprecation warnings because of Stream #626
Comments
This is more of a Scala question than a ScalaCheck question. However, we also ran in to it. We just disable fatal warnings in the 2.13 portion of the build: https://github.com/typelevel/scalacheck/blob/d5967d2/build.sbt#L88 |
Concerning ScalaCheck still using Stream for shrinking: We have to support multiple versions of Scala, including Scala 2.11 and Scala 2.12, so we haven't moved to LazyList for shrinking, yet. It's on the list of things to do for ScalaCheck 2.0. |
Would it be possible to support both types in your interface until then? (see above) Maybe not via a second apply function as suggested above, because LazyList does not exist in older versions. But maybe one could do a scala 2.13 compatability package. But I am not sure if that would be worth it. |
I believe there are a couple of issues with switching to LazyList for shrinking. It would be nice if it didn't require 2.0, but I recall it did. It was a while ago, and I didn't investigate it thoroughly, though. It was about the time we were working on 2.13 in #411. |
It wouldn't need to be a separate package, it could just be a small amount of Scala-version-specific sources. I think a pull request that did this would be accepted (at least, I don't see why not). |
I'll have a look and see what I can do |
Created a draft pull request. I am not sure about the name of the helper, so happy for suggestions on that point. (Or on anything else as I do not know the scalacheck codebase that well.) I opted for creating a new class instead of creating a scala 2.13 variant of Shrink with an additional method to not make the codebase complexer. |
Thanks for looking in to it. Maybe there will be a way. We'll just need to consider any impact on the eventual switch to LazyList for Shrink down the road and significant changes planned for Shrink. |
I am currently porting code to scala 2.13 and am not able to get rid of deprecation warnings concerning Stream (replaced by LazyList) because of it's use in the interface of Shrink.
Is there a way to do so? A second apply method in Shrink would be handy:
def apply[T](s: T => LazyList[T]): Shrink[T] = ???
Or am I missing something?
The text was updated successfully, but these errors were encountered: