Re:Ask HN: TypeScript experts, is this a type checking issue?
by sbergot on Sunday September 01, 2019 @09:37AM
(#20852192)
The 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.
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).