Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mberndt123
Copy link
Contributor

No description provided.

**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.

@kyri-petrou kyri-petrou merged commit d5ebfc8 into zio:series/2.x Feb 10, 2025
18 checks passed
@mberndt123 mberndt123 deleted the fix-zsink-last-type branch April 28, 2025 00:41
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.

3 participants