We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
caseError
In this case:
class NoNegativesError extends Error { NoNegativesError = 'NoNegativesError'; } const rejectNegative = (x: number): Task<number, NoNegativesError> => x >= 0 ? Task.resolve(x) : Task.reject(new NoNegativesError()) ; const aNumber = rejectNegative(9); const fixNoNegativesError = caseError(NoNegativesError, _ => Task.resolve(0)); const result = aNumber.catch(fixNoNegativesError);
We expect result to be a Task<number, UncaughtError> but it is a Task<number, NoNegativesError | UncaughtError>. If we had:
result
Task<number, UncaughtError>
Task<number, NoNegativesError | UncaughtError>
const aNumber = rejectNegative(9).map(x => x);
the result would have been the expected one.
This bug is associated with caseError and happens only with Tasks rejected with only one type.
The text was updated successfully, but these errors were encountered:
60998f1
🎉 This issue has been resolved in version 1.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
Sorry, something went wrong.
dggluz
No branches or pull requests
In this case:
We expect
result
to be aTask<number, UncaughtError>
but it is aTask<number, NoNegativesError | UncaughtError>
. If we had:the result would have been the expected one.
This bug is associated with
caseError
and happens only with Tasks rejected with only one type.The text was updated successfully, but these errors were encountered: