diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPropertyAccessor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPropertyAccessor.java index 79cd547202f..7f01b3c4f22 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPropertyAccessor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPropertyAccessor.java @@ -143,4 +143,9 @@ public class KtPropertyAccessor extends KtDeclarationStub) { diff --git a/compiler/tests/org/jetbrains/kotlin/renderer/AbstractDescriptorRendererTest.kt b/compiler/tests/org/jetbrains/kotlin/renderer/AbstractDescriptorRendererTest.kt index cfeb903e750..a5f50826d56 100644 --- a/compiler/tests/org/jetbrains/kotlin/renderer/AbstractDescriptorRendererTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/renderer/AbstractDescriptorRendererTest.kt @@ -97,8 +97,8 @@ public abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment } override fun visitPropertyAccessor(accessor: KtPropertyAccessor) { - val parent = accessor.getParent() as KtProperty - val propertyDescriptor = getDescriptor(parent, container) as PropertyDescriptor + val property = accessor.property + val propertyDescriptor = getDescriptor(property, container) as PropertyDescriptor if (accessor.isGetter()) { descriptors.add(propertyDescriptor.getGetter()!!) } diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinBasicStepMethodFilter.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinBasicStepMethodFilter.kt index 10e894c0647..28045743456 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinBasicStepMethodFilter.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinBasicStepMethodFilter.kt @@ -35,7 +35,7 @@ public class KotlinBasicStepMethodFilter( myTargetMethodName = when (resolvedElement) { is KtAnonymousInitializer -> "" is KtConstructor<*> -> "" - is KtPropertyAccessor -> JvmAbi.getterName((resolvedElement.parent as KtProperty).name!!) + is KtPropertyAccessor -> JvmAbi.getterName((resolvedElement.property).name!!) else -> resolvedElement.name!! } } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableMutabilityFix.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableMutabilityFix.kt index 284294fa9ec..b030c755ff1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableMutabilityFix.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableMutabilityFix.kt @@ -53,8 +53,7 @@ public class ChangeVariableMutabilityFix(element: KtNamedDeclaration, private va public val VAL_WITH_SETTER_FACTORY: KotlinSingleIntentionActionFactory = object: KotlinSingleIntentionActionFactory() { override fun createAction(diagnostic: Diagnostic): IntentionAction? { val accessor = diagnostic.psiElement as KtPropertyAccessor - val property = accessor.parent as KtProperty - return ChangeVariableMutabilityFix(property, true) + return ChangeVariableMutabilityFix(accessor.property, true) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt index a6859360fd5..efeddc75216 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt @@ -354,7 +354,7 @@ public fun chooseContainerElement( object : PsiElementListCellRenderer() { private fun PsiElement.renderName(): String { if (this is KtPropertyAccessor) { - return (parent as KtProperty).renderName() + if (isGetter) ".get" else ".set" + return property.renderName() + if (isGetter) ".get" else ".set" } if (this is KtObjectDeclaration && this.isCompanion()) { return "Companion object of ${getStrictParentOfType()?.renderName() ?: ""}"