Skip to content

Commit d5dd165

Browse files
committed
Ensure default value is assignable if we have a Failure
1 parent fbf75eb commit d5dd165

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ export class Result<T, E> {
13281328
}
13291329

13301330
/** Get the value if this is a success, or return the default value if this is a failure. */
1331-
orElse(defaultValue: T): T {
1331+
orElse<U>(defaultValue: U): T | U {
13321332
return this.isSuccess() ? this.value : defaultValue;
13331333
}
13341334
}

0 commit comments

Comments
 (0)