Currently (TS v.1.5.2) the compiler does not do inference correctly for certain cases:
#3038
Although it is by design, reflected in the spec and there is no viable way for doing it correctly, I think the compiler has to be honest to the developer and instead of generating faulty code, it has to break with an error message that would say that the inferred types cannot be resolved.
Currently (TS v.1.5.2) the compiler does not do inference correctly for certain cases:
#3038
Although it is by design, reflected in the spec and there is no viable way for doing it correctly, I think the compiler has to be honest to the developer and instead of generating faulty code, it has to break with an error message that would say that the inferred types cannot be resolved.