Postpone counting light elements till all psi checks done
This commit is contained in:
+15
-8
@@ -110,17 +110,24 @@ class KotlinOverridingMethodReferenceSearcher : MethodUsagesSearcher() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
var lightMethods = refElement.toLightMethods()
|
fun countNonFinalLightMethods() = refElement
|
||||||
|
.toLightMethods()
|
||||||
.filterNot { it.hasModifierProperty(PsiModifier.FINAL) }
|
.filterNot { it.hasModifierProperty(PsiModifier.FINAL) }
|
||||||
.ifEmpty { return true }
|
|
||||||
if (refElement is KtProperty || refElement is KtParameter) {
|
val lightMethods = when (refElement) {
|
||||||
if (isWrongAccessorReference()) return true
|
is KtProperty, is KtParameter -> {
|
||||||
lightMethods = lightMethods.filter { JvmAbi.isGetterName(it.name) == isGetter }
|
if (isWrongAccessorReference()) return true
|
||||||
}
|
countNonFinalLightMethods().filter { JvmAbi.isGetterName(it.name) == isGetter }
|
||||||
if (refElement is KtNamedFunction) {
|
}
|
||||||
lightMethods = lightMethods.filter { it.name == method.name }
|
|
||||||
|
is KtNamedFunction ->
|
||||||
|
countNonFinalLightMethods().filter { it.name == method.name }
|
||||||
|
|
||||||
|
else ->
|
||||||
|
countNonFinalLightMethods()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return lightMethods.all { super.processInexactReference(ref, it, method, consumer) }
|
return lightMethods.all { super.processInexactReference(ref, it, method, consumer) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user