Implement members: fix it works correctly if primary constructor has implemented member
#KT-37312 Fixed
This commit is contained in:
committed by
Ilya Kirillov
parent
5eabc1117f
commit
e455e926aa
+2
-1
@@ -36,6 +36,7 @@ import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.prevSiblingOfSameType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
@@ -147,7 +148,7 @@ abstract class OverrideImplementMembersHandler : LanguageCodeInsightActionHandle
|
||||
fun ClassDescriptor.findElement(memberDescriptor: CallableMemberDescriptor): KtDeclaration? {
|
||||
return implementedElements[memberDescriptor]
|
||||
?: (findCallableMemberBySignature(memberDescriptor)?.source?.getPsi() as? KtDeclaration)
|
||||
?.takeIf { it != classOrObject }
|
||||
?.takeIf { it != classOrObject && it !is KtParameter }
|
||||
?.also { implementedElements[memberDescriptor] = it }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user