File tree Expand file tree Collapse file tree
crates/red_knot_python_semantic Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,13 +26,10 @@ def True(for):
2626 # error: [invalid-syntax]
2727 pass
2828
29- # TODO : Why is there two diagnostics for the same error?
30-
3129# error: [invalid-syntax]
3230# error: [invalid-syntax]
3331# error: [invalid-syntax]
3432# error: [unresolved-reference] "Name `pass` used when not defined"
35- # error: [unresolved-reference] "Name `pass` used when not defined"
3633for while in pass :
3734 pass
3835
@@ -58,12 +55,10 @@ match while:
5855### Attribute expression
5956
6057``` py
61- # TODO : Why is there two diagnostics for the same error?
6258# TODO : Check when support for attribute expressions is added
6359
6460# error: [invalid-syntax]
6561# error: [unresolved-reference] "Name `foo` used when not defined"
66- # error: [unresolved-reference] "Name `foo` used when not defined"
6762for x in foo.pass :
6863 pass
6964```
Original file line number Diff line number Diff line change @@ -1900,12 +1900,11 @@ impl<'db> TypeInferenceBuilder<'db> {
19001900 is_async : _,
19011901 } = for_statement;
19021902
1903- self . infer_standalone_expression ( iter) ;
1904-
19051903 // TODO more complex assignment targets
19061904 if let ast:: Expr :: Name ( name) = & * * target {
19071905 self . infer_definition ( name) ;
19081906 } else {
1907+ self . infer_standalone_expression ( iter) ;
19091908 self . infer_expression ( target) ;
19101909 }
19111910 self . infer_body ( body) ;
You can’t perform that action at this time.
0 commit comments