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

more general type for ZSink.last #9506

Merged
merged 2 commits into from
Feb 10, 2025

Conversation

mberndt123
Copy link
Contributor

No description provided.

@@ -26,7 +26,7 @@ val head: ZIO[Any, Nothing, Option[Int]] = ZStream(1, 2, 3, 4).run(s
**ZSink.last** — It consumes all elements of a stream and returns the last element of the stream:

```scala mdoc:silent:nest
val sink: ZSink[Any, Nothing, Int, Int, Option[Int]] = ZSink.last[Int]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it compile if you leave it as is?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because the L type parameter is covariant.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@kyri-petrou kyri-petrou merged commit d5ebfc8 into zio:series/2.x Feb 10, 2025
18 checks passed
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