I managed to make the error go away while still being able to compute the type properly with the usage of @ts-ignore. An example can be found in the playground, in a nutshell if you remove the // @ts-ignore
, in a full-fledged development environment, line I imagine that the code would not compile.