Commit e9941cd 1 parent 43bf1a8 commit e9941cd Copy full SHA for e9941cd
File tree 2 files changed +1
-7
lines changed
crates/red_knot_python_semantic
2 files changed +1
-7
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,10 @@ def True(for):
26
26
# error: [invalid-syntax]
27
27
pass
28
28
29
- # TODO : Why is there two diagnostics for the same error?
30
-
31
29
# error: [invalid-syntax]
32
30
# error: [invalid-syntax]
33
31
# error: [invalid-syntax]
34
32
# error: [unresolved-reference] "Name `pass` used when not defined"
35
- # error: [unresolved-reference] "Name `pass` used when not defined"
36
33
for while in pass :
37
34
pass
38
35
@@ -58,12 +55,10 @@ match while:
58
55
### Attribute expression
59
56
60
57
``` py
61
- # TODO : Why is there two diagnostics for the same error?
62
58
# TODO : Check when support for attribute expressions is added
63
59
64
60
# error: [invalid-syntax]
65
61
# error: [unresolved-reference] "Name `foo` used when not defined"
66
- # error: [unresolved-reference] "Name `foo` used when not defined"
67
62
for x in foo.pass :
68
63
pass
69
64
```
Original file line number Diff line number Diff line change @@ -1900,12 +1900,11 @@ impl<'db> TypeInferenceBuilder<'db> {
1900
1900
is_async : _,
1901
1901
} = for_statement;
1902
1902
1903
- self . infer_standalone_expression ( iter) ;
1904
-
1905
1903
// TODO more complex assignment targets
1906
1904
if let ast:: Expr :: Name ( name) = & * * target {
1907
1905
self . infer_definition ( name) ;
1908
1906
} else {
1907
+ self . infer_standalone_expression ( iter) ;
1909
1908
self . infer_expression ( target) ;
1910
1909
}
1911
1910
self . infer_body ( body) ;
You can’t perform that action at this time.
0 commit comments