4 ms·
Thanks for the reply. I'm writing a ts parser and stumbled over this. The reason I find it strange is that in this case it appears detectable that the return t
by chupa-chups 7y ago
Thanks for the reply. I'm writing a ts parser and stumbled over this.
The reason I find it strange is that in this case it appears detectable that the return type will not match (independent of the any type in the parameter).
Is there a reason not to check this I'm not seeing?
By the way, I am quite amazed at the quality (and depth) of the typescript type inference & check model (despite it being "not sound" to quote you).
- sbergot 7y agoThe reason is that any is an escape mechanism. Typescript will never complain about anything when dealing with this type. Its use case is to perform a step by step migrations from js or to deal with rare corner cases when you can prove yourself that the code is correct.