-
Notifications
You must be signed in to change notification settings - Fork 146
Open
Description
When using .andThrough() with a function that returns a Result, TypeScript reports a type mismatch, even though the function signature should be compatible.
part of code
ok({
title: "title",
description: "description",
})
.andThen((s) => ok(s))
.andThrough(assertPublishable) // <= error happencurrent return type
Result<{
title: string;
description: string;
}, Error_A>expected return type
Result<{
title: string;
description: string;
}, Error_A | Error_B>Curiously, if I comment out .andThen((s) => ok(s)), the error disappears and the return type becomes exactly as expected.
typescript playground is here
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels