mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[python] Safe delete parameter (PyOverloadsInspection.kt)
GitOrigin-RevId: 0ddcc5f031c4f51e0e54e16ab0928e38ed6af464
This commit is contained in:
committed by
intellij-monorepo-bot
parent
d5e20b2188
commit
cd00f30c84
+3
-3
@@ -121,7 +121,7 @@ class PyOverloadsInspection : PyInspection() {
|
||||
private fun checkOverride(overloads: List<PyFunction>, implementation: PyFunction?) {
|
||||
if (implementation == null) {
|
||||
for (overload in overloads.tail()) {
|
||||
if (isOverride(overload, myTypeEvalContext)) {
|
||||
if (isOverride(overload)) {
|
||||
registerProblem(overload.nameIdentifier,
|
||||
PyPsiBundle.message("INSP.overloads.override.should.be.placed.only.on.the.first.overload"))
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class PyOverloadsInspection : PyInspection() {
|
||||
}
|
||||
else {
|
||||
for (overload in overloads) {
|
||||
if (isOverride(overload, myTypeEvalContext)) {
|
||||
if (isOverride(overload)) {
|
||||
registerProblem(overload.nameIdentifier,
|
||||
PyPsiBundle.message("INSP.overloads.override.should.be.placed.on.the.implementation"))
|
||||
}
|
||||
@@ -137,7 +137,7 @@ class PyOverloadsInspection : PyInspection() {
|
||||
}
|
||||
}
|
||||
|
||||
private fun isOverride(function: PyFunction, context: TypeEvalContext): Boolean {
|
||||
private fun isOverride(function: PyFunction): Boolean {
|
||||
val decoratorList = function.decoratorList ?: return false
|
||||
return decoratorList.decorators.any { decorator ->
|
||||
PyKnownDecoratorUtil.asKnownDecorators(decorator, myTypeEvalContext).any {
|
||||
|
||||
Reference in New Issue
Block a user