From 150477ceb0e55d680f0952f224212b5d77a752d7 Mon Sep 17 00:00:00 2001 From: smaspe Date: Wed, 27 Mar 2024 12:26:38 +0100 Subject: [PATCH] status should be a number in OpErrorType the private `never: unique symbol` causes inferred types to "references an inaccessible 'unique symbol' type." in places where explicit type annotations are not possible. It doesn't seem necessary to use `typeof never`, as `number` should work just as well. --- src/types.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/types.ts b/src/types.ts index 4fcfb971..aa4fc80d 100644 --- a/src/types.ts +++ b/src/types.ts @@ -63,12 +63,9 @@ type _OpDefaultReturnType = 'default' extends keyof T export type OpDefaultReturnType = _OpDefaultReturnType> -// private symbol to prevent narrowing on "default" error status -const never: unique symbol = Symbol() - type _OpErrorType = { [S in Exclude]: { - status: S extends 'default' ? typeof never : S + status: S extends 'default' ? number : S data: T[S] } }[Exclude]