mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-07 13:15:06 +00:00
[ty] Fix panic for attribute expressions with empty value
This commit is contained in:
parent
dac4e356eb
commit
f15f930053
2 changed files with 8 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
[.
|
|
@ -5675,6 +5675,13 @@ impl<'db, 'ast> TypeInferenceBuilder<'db, 'ast> {
|
|||
};
|
||||
(place, None)
|
||||
} else {
|
||||
if expr_ref
|
||||
.as_name_expr()
|
||||
.is_some_and(|name| name.is_invalid())
|
||||
{
|
||||
return (Place::Unbound, None);
|
||||
}
|
||||
|
||||
let use_id = expr_ref.scoped_use_id(db, scope);
|
||||
let place = place_from_bindings(db, use_def.bindings_at_use(use_id));
|
||||
(place, Some(use_id))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue