mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
[red-knot] Move standalone expr inference to for
non-name target (#14788)
## Summary Ref: https://github.com/astral-sh/ruff/pull/14754#discussion_r1871040646 ## Test Plan Remove the TODO comment and update the mdtest.
This commit is contained in:
parent
43bf1a8907
commit
e9941cd714
2 changed files with 1 additions and 7 deletions
|
@ -1900,12 +1900,11 @@ impl<'db> TypeInferenceBuilder<'db> {
|
|||
is_async: _,
|
||||
} = for_statement;
|
||||
|
||||
self.infer_standalone_expression(iter);
|
||||
|
||||
// TODO more complex assignment targets
|
||||
if let ast::Expr::Name(name) = &**target {
|
||||
self.infer_definition(name);
|
||||
} else {
|
||||
self.infer_standalone_expression(iter);
|
||||
self.infer_expression(target);
|
||||
}
|
||||
self.infer_body(body);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue