You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
This would be throwing a lot of babies out with very little bathwater. There is tons of code that hits that part of the spec where the types are correct and it would be counterproductive to issue an error in those cases.
For those parts that are correct no errors are necessary, for other parts that cannot be resolved properly such issue would be very much appreciated. Is there a problem with detecting what can and what cannot be inferred ahead, so that both correct cases with generated code and incorrect ones with error messages are properly covered?
So we might want to keep this issue open please, don't we? It is certainly a problem that the compiler doesn't work property and it deserves some attention from the community. There are a lot of open requests that ask for much sillier features than this one and yet they don't get closed.
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.
The text was updated successfully, but these errors were encountered: