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

Allow uses of Try with nullable error types (Try<S, F?>) #546

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

qnga
Copy link
Contributor

@qnga qnga commented Jul 16, 2024

No description provided.

@qnga qnga requested a review from mickael-menu July 16, 2024 11:19
Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

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

I changed my mind. In which case does it make sense to have a nullable failure type instead of a null result?

@mickael-menu mickael-menu self-requested a review July 22, 2024 08:31
@qnga
Copy link
Contributor Author

qnga commented Jul 22, 2024

To convey the idea that there was a failure we know nothing about. Anyway, there's a mistake in the current code: this kind of types is accepted by the compiler but fails at runtime.

Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

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

Fair enough for the runtime failure. I'm not sure I would use the nullable failure even in the case you mentioned though. I guess we'll see on a case-by-case basis.

@mickael-menu mickael-menu merged commit f43dbb3 into develop Jul 22, 2024
3 checks passed
@mickael-menu mickael-menu deleted the fix/try branch July 22, 2024 08:49
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.

2 participants