mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-08 04:38:04 +00:00
[ty] Fix panic for attribute expressions with empty value (#19069)
## Summary closes https://github.com/astral-sh/ty/issues/738 ## Test Plan Added corpus test
This commit is contained in:
parent
05139a323b
commit
ab3af924ef
2 changed files with 8 additions and 0 deletions
|
@ -0,0 +1 @@
|
|||
[.
|
|
@ -5754,6 +5754,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