diff --git a/python/python-psi-impl/src/com/jetbrains/python/inspections/PyTypeHintsInspection.kt b/python/python-psi-impl/src/com/jetbrains/python/inspections/PyTypeHintsInspection.kt index 61cbce0677f6..013a3f8a0f56 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/inspections/PyTypeHintsInspection.kt +++ b/python/python-psi-impl/src/com/jetbrains/python/inspections/PyTypeHintsInspection.kt @@ -810,8 +810,8 @@ class PyTypeHintsInspection : PyInspection() { private fun checkGenericCompleteness(cls: PyClass) { var seenGeneric = false - val genericTypeVars = linkedSetOf() - val nonGenericTypeVars = linkedSetOf() + val genericTypeVars = linkedSetOf() + val nonGenericTypeVars = linkedSetOf() cls.superClassExpressions.forEach { superClass -> val generics = collectGenerics(superClass) @@ -827,13 +827,11 @@ class PyTypeHintsInspection : PyInspection() { if (seenGeneric && (nonGenericTypeVars - genericTypeVars).isNotEmpty()) { val nonGenericTypeVarsNames = nonGenericTypeVars .asSequence() - .filterIsInstance() .mapNotNull { it.name } .joinToString(", ") val genericTypeVarsNames = genericTypeVars .asSequence() - .filterIsInstance() .mapNotNull { it.name } .joinToString(", ") @@ -844,14 +842,14 @@ class PyTypeHintsInspection : PyInspection() { } } - private fun collectGenerics(superClassExpression: PyExpression): Pair?, Set> { + private fun collectGenerics(superClassExpression: PyExpression): Pair?, Set> { val resolvedSuperClass = if (superClassExpression is PyReferenceExpression) multiFollowAssignmentsChain(superClassExpression) else listOf(superClassExpression) var seenGeneric = false - val genericTypeVars = linkedSetOf() - val nonGenericTypeVars = linkedSetOf() + val genericTypeVars = linkedSetOf() + val nonGenericTypeVars = linkedSetOf() resolvedSuperClass .asSequence()