mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 01:50:38 +00:00
[ty] Fix panic when pulling types for UnaryOp
expressions inside Literal
slices (#18536)
This commit is contained in:
parent
95497ffaab
commit
72552f31e4
3 changed files with 4 additions and 11 deletions
|
@ -9481,7 +9481,9 @@ impl<'db> TypeInferenceBuilder<'db, '_> {
|
|||
if matches!(u.op, ast::UnaryOp::USub | ast::UnaryOp::UAdd)
|
||||
&& u.operand.is_number_literal_expr() =>
|
||||
{
|
||||
self.infer_unary_expression(u)
|
||||
let ty = self.infer_unary_expression(u);
|
||||
self.store_expression_type(parameters, ty);
|
||||
ty
|
||||
}
|
||||
_ => {
|
||||
self.infer_expression(parameters);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue