From 121e949a333278821302a8f68a57cdb0efaae831 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Mon, 12 Sep 2016 12:06:01 +0300 Subject: [PATCH] Minor: LocalVariableAccessorDescriptor modality should be FINAL (otherwise it breaks MemberDescriptor contract). --- .../descriptors/impl/LocalVariableAccessorDescriptor.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/descriptors/impl/LocalVariableAccessorDescriptor.kt b/compiler/frontend/src/org/jetbrains/kotlin/descriptors/impl/LocalVariableAccessorDescriptor.kt index 6171b4ccc32..bcac3b7cd27 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/descriptors/impl/LocalVariableAccessorDescriptor.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/descriptors/impl/LocalVariableAccessorDescriptor.kt @@ -16,10 +16,7 @@ package org.jetbrains.kotlin.descriptors.impl -import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor -import org.jetbrains.kotlin.descriptors.SourceElement -import org.jetbrains.kotlin.descriptors.VariableAccessorDescriptor -import org.jetbrains.kotlin.descriptors.Visibilities +import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.KotlinType @@ -42,11 +39,12 @@ sealed class LocalVariableAccessorDescriptor( init { val valueParameters = if (isGetter) emptyList() else createValueParameter(Name.identifier("value"), correspondingVariable.type).singletonList() - initialize(null, null, emptyList(), valueParameters, correspondingVariable.type, null, Visibilities.LOCAL) + initialize(null, null, emptyList(), valueParameters, correspondingVariable.type, Modality.FINAL, Visibilities.LOCAL) } private fun createValueParameter(name: Name, type: KotlinType): ValueParameterDescriptorImpl { return ValueParameterDescriptorImpl(this, null, 0, Annotations.EMPTY, name, type, false, false, false, false, null, SourceElement.NO_SOURCE) } + }