Don't run another method reference search for constructors (KT-17751)

Constructors can't be used as properties and have no overrides.
This commit is contained in:
Nikolay Krasko
2017-06-29 21:13:45 +03:00
parent 37982e4bb1
commit 0cd8ee57b8
@@ -42,9 +42,14 @@ import org.jetbrains.kotlin.utils.ifEmpty
class KotlinOverridingMethodReferenceSearcher : MethodUsagesSearcher() {
override fun processQuery(p: MethodReferencesSearch.SearchParameters, consumer: Processor<PsiReference>) {
val method = p.method
val isConstructor = p.project.runReadActionInSmartMode { method.isConstructor }
if (isConstructor) {
return
}
super.processQuery(p, consumer)
val method = p.method
p.project.runReadActionInSmartMode {
val containingClass = method.containingClass ?: return@runReadActionInSmartMode