Avoid redundant extra errors after "Need type annotation for variable" #6998
Labels
priority-0-high
semantic-analyzer
Problems that happen during semantic analysis
topic-type-variables
topic-usability
Consider this (oversimplified) example:
The subsequent errors look redundant (and maybe even annoying). This is more important with the new semantic analyzer because the old one doesn't show the error if the problematic variable was defined at the function scope.
Potentially, we can replace
<nothing>
withAny
after we show the error. Also the code that detects failed inference can be improved. For example,is_valid_inferred_type()
should be replaced with a proper type visitor.The text was updated successfully, but these errors were encountered: