skip inferred annotations

This commit is contained in:
Douglas Creager 2025-12-16 13:02:16 -05:00
parent ed8a7af5e2
commit 9eb3e2e201
2 changed files with 2 additions and 1 deletions

View File

@ -1257,6 +1257,7 @@ impl<'db> ClassType<'db> {
let self_annotation = signature
.parameters()
.get_positional(0)
.filter(|parameter| !parameter.inferred_annotation)
.and_then(Parameter::annotated_type)
.filter(|ty| {
ty.as_typevar()

View File

@ -2167,7 +2167,7 @@ pub(crate) struct Parameter<'db> {
/// Does the type of this parameter come from an explicit annotation, or was it inferred from
/// the context, like `Self` for the `self` parameter of instance methods.
inferred_annotation: bool,
pub(crate) inferred_annotation: bool,
kind: ParameterKind<'db>,
pub(crate) form: ParameterForm,