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
{{ message }}
Repository navigation
Suggestion: Display a honest message when inference cannot be done correctly #3055
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.
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.
Activity
RyanCavanaugh commentedon May 6, 2015
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.
zpdDG4gta8XKpMCd commentedon May 6, 2015
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?
RyanCavanaugh commentedon May 6, 2015
The entire problem is that we don't have an algorithm for determining what's an error and what isn't.
We didn't have that capability and then randomly decide to not issue errors in some cases, of course.
zpdDG4gta8XKpMCd commentedon May 6, 2015
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.
JsonFreeman commentedon May 7, 2015
This is a duplicate of #3038.