Type instantiation is excessively deep and possibly infinite
This used to work for me in in
2.0.0-dev.29
. But upgrading to 2.0.0-rc.5
I get:
6 Replies
Describe doesn't change the underlying type why not just:
In general when it comes to this kind of stuff relying on TS to calculate your generic returns is not a good idea.
If you're creating wrapper functions, you'll want to manually annotate the return type, even if it seems to work fine with TS directly because of nonsense like that I can't test for
Ok I'll try
This isn't working for my use case unfortunately
That doesn't make any sense just cast the return to never
It now seems to be infering as
Type.Any
for the generic parameter
So that's causing me a ton of problems
grr yeah so now I need to know the type ahead of the call so I can set the correct generic
For example:
Oh that sucks
Ideally
Type.Any
would allow any type
I think it is related to the recent changes that allow the methods chained off Type
to be specific to what is inferred
You can open an issue "all types should be assignable to Type.any
" with a repro like this:
For my purposes, I was able to create a workaround: