You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the latest released version (4.2.0) and the development version from the master branch this code
const result = Err('boo') as Result<number, string>
const resultAfterOrElse = result.orElse((error) => Err(error))
will fail to compile:
root@54b019d15fcf:/lune/ts-results-es# npm test
> [email protected] test
> jest
FAIL test/result.test.ts
● Test suite failed to run
test/result.test.ts:327:38 - error TS2349: This expression is not callable.
Each member of the union type '(<R extends Result<number, unknown>>(_other: (error: never) => R) => OkImpl<number>) | (<R extends Result<unknown, unknown>>(other: (error: string) => R) => R)' has signatures, but none of those signatures are compatible with each other.
327 const resultAfterOrElse = result.orElse((error) => Err(error))
~~~~~~
test/result.test.ts:327:46 - error TS7006: Parameter 'error' implicitly has an 'any' type.
327 const resultAfterOrElse = result.orElse((error) => Err(error))
~~~~~
so it seems that Result.orElse has been broken for a while.
The text was updated successfully, but these errors were encountered:
With the latest released version (4.2.0) and the development version from the master branch this code
will fail to compile:
so it seems that
Result.orElse
has been broken for a while.The text was updated successfully, but these errors were encountered: