[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:
@@ -26,13 +26,10 @@ def True(for):
|
||||
# error: [invalid-syntax]
|
||||
pass
|
||||
|
||||
# TODO: Why is there two diagnostics for the same error?
|
||||
|
||||
# error: [invalid-syntax]
|
||||
# error: [invalid-syntax]
|
||||
# error: [invalid-syntax]
|
||||
# error: [unresolved-reference] "Name `pass` used when not defined"
|
||||
# error: [unresolved-reference] "Name `pass` used when not defined"
|
||||
for while in pass:
|
||||
pass
|
||||
|
||||
@@ -58,12 +55,10 @@ match while:
|
||||
### Attribute expression
|
||||
|
||||
```py
|
||||
# TODO: Why is there two diagnostics for the same error?
|
||||
# TODO: Check when support for attribute expressions is added
|
||||
|
||||
# error: [invalid-syntax]
|
||||
# error: [unresolved-reference] "Name `foo` used when not defined"
|
||||
# error: [unresolved-reference] "Name `foo` used when not defined"
|
||||
for x in foo.pass:
|
||||
pass
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user