mirror of https://github.com/astral-sh/ruff
skip inferred annotations
This commit is contained in:
parent
ed8a7af5e2
commit
9eb3e2e201
|
|
@ -1257,6 +1257,7 @@ impl<'db> ClassType<'db> {
|
||||||
let self_annotation = signature
|
let self_annotation = signature
|
||||||
.parameters()
|
.parameters()
|
||||||
.get_positional(0)
|
.get_positional(0)
|
||||||
|
.filter(|parameter| !parameter.inferred_annotation)
|
||||||
.and_then(Parameter::annotated_type)
|
.and_then(Parameter::annotated_type)
|
||||||
.filter(|ty| {
|
.filter(|ty| {
|
||||||
ty.as_typevar()
|
ty.as_typevar()
|
||||||
|
|
|
||||||
|
|
@ -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
|
/// 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.
|
/// the context, like `Self` for the `self` parameter of instance methods.
|
||||||
inferred_annotation: bool,
|
pub(crate) inferred_annotation: bool,
|
||||||
|
|
||||||
kind: ParameterKind<'db>,
|
kind: ParameterKind<'db>,
|
||||||
pub(crate) form: ParameterForm,
|
pub(crate) form: ParameterForm,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue