🧰 type util
An error for unexpected failure of infer type.
In your type, you can use T extends infer U extends V to specify the type of the inferred type U.
T extends infer U extends V
U
But doing so means you have to do an extra conditional type.
This type can be use in the else case to indicate unexpected failure to infer the type.
type F<T> = T extends infer U extends V ? ...your type logic... : InferError<'some message', T> Copy
type F<T> = T extends infer U extends V ? ...your type logic... : InferError<'some message', T>
🧰 type util
An error for unexpected failure of infer type.
In your type, you can use
T extends infer U extends V
to specify the type of the inferred typeU
.But doing so means you have to do an extra conditional type.
This type can be use in the else case to indicate unexpected failure to infer the type.