From 0381018d001d3faa9aa337ace229d77007d922ec Mon Sep 17 00:00:00 2001 From: Vasily Kirichenko Date: Sun, 11 Jun 2017 12:36:37 +0300 Subject: [PATCH] add the check into CanBePrimaryConstructorPropertyInspection as well --- .../inspections/CanBePrimaryConstructorPropertyInspection.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/CanBePrimaryConstructorPropertyInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/CanBePrimaryConstructorPropertyInspection.kt index fc0090e93d8..0399cc55c07 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/CanBePrimaryConstructorPropertyInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/CanBePrimaryConstructorPropertyInspection.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully import org.jetbrains.kotlin.idea.intentions.MovePropertyToConstructorIntention +import org.jetbrains.kotlin.idea.refactoring.isInterfaceClass import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtProperty import org.jetbrains.kotlin.psi.KtReferenceExpression @@ -56,6 +57,8 @@ class CanBePrimaryConstructorPropertyInspection : AbstractKotlinInspection() { val assignedParameter = DescriptorToSourceUtils.descriptorToDeclaration(assignedDescriptor) as? KtParameter ?: return if (property.containingClassOrObject !== assignedParameter.containingClassOrObject) return + if (property.containingClassOrObject?.isInterfaceClass() ?: false) return + holder.registerProblem(holder.manager.createProblemDescriptor( nameIdentifier, nameIdentifier,