mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:25:17 +00:00
[red-knot] Any
cannot be parameterized (#14933)
This commit is contained in:
parent
82faa9bb62
commit
45b565cbb5
2 changed files with 23 additions and 1 deletions
|
@ -4863,7 +4863,17 @@ impl<'db> TypeInferenceBuilder<'db> {
|
|||
}
|
||||
KnownInstanceType::Type => self.infer_subclass_of_type_expression(parameters),
|
||||
KnownInstanceType::Tuple => self.infer_tuple_type_expression(parameters),
|
||||
KnownInstanceType::Any => Type::Any,
|
||||
KnownInstanceType::Any => {
|
||||
self.diagnostics.add_lint(
|
||||
&INVALID_TYPE_PARAMETER,
|
||||
subscript.into(),
|
||||
format_args!(
|
||||
"Type `{}` expected no type parameter",
|
||||
known_instance.repr(self.db)
|
||||
),
|
||||
);
|
||||
Type::Unknown
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue