Skip to content

Commit

Permalink
fix(compiler): Align return types of ErrImp<E> and OkImpl<T> with…
Browse files Browse the repository at this point in the history
… `Result<T, E>` for TS 5.5 (#30345)
  • Loading branch information
nikeee authored Jul 16, 2024
1 parent 270222b commit 6c0386e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ class OkImpl<T> implements Result<T, never> {
return this;
}

isOk(): boolean {
isOk(): this is OkImpl<T> {
return true;
}

isErr(): boolean {
isErr(): this is ErrImpl<never> {
return false;
}

Expand Down Expand Up @@ -199,11 +199,11 @@ class ErrImpl<E> implements Result<never, E> {
return fn(this.val);
}

isOk(): boolean {
isOk(): this is OkImpl<never> {
return false;
}

isErr(): boolean {
isErr(): this is ErrImpl<E> {
return true;
}

Expand Down

0 comments on commit 6c0386e

Please sign in to comment.