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

Add Dotty support for FS2 2.x #1973

Merged
merged 14 commits into from Jul 29, 2020
Merged

Conversation

mpilquist
Copy link
Member

@mpilquist mpilquist commented Jul 28, 2020

This PR backports Dotty support to FS2 2.x. Most of the changes are mechanical based on the develop branch, though a handful needed different workarounds. In particular:

  • Instead of moving debug and debugChunks to InvariantOps, which would be a binary incompatible, we use @uncheckedVariance
  • parJoin and parJoinUnbounded get their F2[_] <:< F[_] param changed to F2[Any] <:< F[Any] (whereas on develop branch, they get moved to InvariantOps)
  • the base64 encoding/decoding operations were deprecated and replaced with a new text.base64 object to work around Dotty overloading issues

@@ -228,8 +229,8 @@ class CompressionSuite extends Fs2Suite {
test("deflate and inflate are reusable") {
val bytesIn: Int = 1024 * 1024
val chunkSize = 1024
val deflater = deflate[IO](bufferSize = chunkSize)
val inflater = inflate[IO](bufferSize = chunkSize)
val deflater = deflate[IO](DeflateParams(bufferSize = chunkSize))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other overload is not callable from Dotty -- appears to be a bug with overloads & default parameters, but I haven't minimized it yet.

@mpilquist
Copy link
Member Author

I'm going to eagerly merge this one but feel free to provide review comments and I'll happily address.

@mpilquist mpilquist merged commit 952c862 into typelevel:main Jul 29, 2020
@johnynek
Copy link
Contributor

Why did so many case classes lose final? Are all case classes final in dotty?

@mpilquist
Copy link
Member Author

@johnynek case objects are final in dotty -- compiler complains otherwise. Case classes can still be marked final though:

scala> final case object One
1 |final case object One
  |^^^^^
  |final modifier is redundant for objects

@mpilquist mpilquist added this to the 2.4.3 milestone Aug 18, 2020
@mpilquist mpilquist deleted the topic/dotty-for-2x branch February 18, 2024 13:33
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

Successfully merging this pull request may close these issues.

None yet

3 participants