Type checker errors should be reported when syntax errors are present #17787
Labels
Area-Diagnostics
mistakes and possible improvements to diagnostics
Bug
Impact-Low
(Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone
Consider this case:
The are two errors:
in
part of thelet
expressionb
nameThe second error is not reported. This has been like that for long time where we tried to minimize cascading type checker errors, so some of them are hidden when there are errors in preceding phases. However, with the significantly improved parser recovery it should be much better to report these errors now. Having any
in
expression helps in this case:But we want a better error reporting while editing too 🙂
The same applies to other case where the parser recovery has been introduced, for example tuple expressions. When there are no syntax errors, type checker errors about the unresolved name and a missing overload are reported:
When typing the second argument (and adding a syntax error in the tuple), the resolved names are reported, but the type checker errors are hidden (even though the parser recovery now allows the subsequent analysis):
When the syntax error is fixed, everything is reported, even a warning about the unused expression result:
Typing subsequent arguments makes errors blink, which is not great:
The text was updated successfully, but these errors were encountered: