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

Skip to content

Conversation

@adamgfraser
Copy link
Contributor

Fixes a bug where fromCompletionStage was not referentially transparent because we were capturing a lazy val not suspended in an effect. One change in semantics to note. Previously if the thunk threw an exception that would be translated into a Die failure. I think since we are returning a Task we should translate it into a Fail failure. Let me know what you think.

Copying @reibitto.

@reibitto
Copy link
Contributor

reibitto commented Jun 4, 2020

Thanks! This looks good to me. Interestingly enough the workaround we're using in the meantime is also wrapping the thunk in an effect. I personally like that change too. 👍

@adamgfraser adamgfraser changed the title Make fromCompletionStage Referentialy Transparent Make fromCompletionStage Referentially Transparent Jun 4, 2020
Copy link
Member

@iravid iravid left a comment

Choose a reason for hiding this comment

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

I think sequencing thrown exceptions as typed failures is an improvement. 😎

@iravid iravid merged commit 7ef93d5 into zio:master Jun 4, 2020
@adamgfraser adamgfraser deleted the fromcompletionstage branch June 4, 2020 19:50
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