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

AsyncResult.andThen return type behaves weirdly sometimes #176

Open
jstasiak opened this issue Sep 25, 2024 · 0 comments
Open

AsyncResult.andThen return type behaves weirdly sometimes #176

jstasiak opened this issue Sep 25, 2024 · 0 comments
Milestone

Comments

@jstasiak
Copy link
Collaborator

TypeScript 5.6.2, ts-results-es 4.2.0.

async function f(x: Result<string, number>) {
    const y1 = x.toAsyncResult()
    const y2 = y1.andThen((value) => Ok('success'))
    const final = await y2.promise
}

final's type is Result<string, unknown> while ideally it should be Result<string, number>.

@jstasiak jstasiak added this to the 5.0.0 milestone Jan 15, 2025
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

No branches or pull requests

1 participant