From e849792712988df427b5b5e2b27246075dd668c1 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Sat, 20 Feb 2016 17:08:11 +0300 Subject: [PATCH] Minor, add KCallableImpl#container --- .../kotlin/reflect/jvm/internal/DescriptorBasedProperty.kt | 2 +- .../src/kotlin/reflect/jvm/internal/KCallableImpl.kt | 2 ++ .../src/kotlin/reflect/jvm/internal/KFunctionImpl.kt | 2 +- .../src/kotlin/reflect/jvm/internal/KPropertyImpl.kt | 6 ++++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/DescriptorBasedProperty.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/DescriptorBasedProperty.kt index a0bbf02679c..4732d212b4e 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/DescriptorBasedProperty.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/DescriptorBasedProperty.kt @@ -24,7 +24,7 @@ import kotlin.reflect.jvm.internal.JvmPropertySignature.JavaField import kotlin.reflect.jvm.internal.JvmPropertySignature.KotlinProperty internal abstract class DescriptorBasedProperty protected constructor( - val container: KDeclarationContainerImpl, + override val container: KDeclarationContainerImpl, name: String, val signature: String, descriptorInitialValue: PropertyDescriptor? diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt index 8fef9178995..759e345281b 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt @@ -33,6 +33,8 @@ internal interface KCallableImpl : KCallable, KAnnotatedElementImpl { val defaultCaller: FunctionCaller<*>? + val container: KDeclarationContainerImpl + override val annotated: Annotated get() = descriptor override val parameters: List diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt index ec4cf465992..d7af505d155 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt @@ -28,7 +28,7 @@ import kotlin.reflect.KotlinReflectionInternalError import kotlin.reflect.jvm.internal.JvmFunctionSignature.* internal open class KFunctionImpl protected constructor( - private val container: KDeclarationContainerImpl, + override val container: KDeclarationContainerImpl, name: String, private val signature: String, descriptorInitialValue: FunctionDescriptor? diff --git a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt index dd675c34106..ad5a709a035 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt @@ -31,8 +31,6 @@ import kotlin.reflect.KProperty internal interface KPropertyImpl : KProperty, KCallableImpl { val javaField: Field? - val container: KDeclarationContainerImpl - val signature: String override val getter: Getter @@ -54,6 +52,8 @@ internal interface KPropertyImpl : KProperty, KCallableImpl { abstract class Getter : Accessor(), KProperty.Getter, KCallableImpl { override val name: String get() = "" + override val container: KDeclarationContainerImpl get() = property.container + override val descriptor: PropertyGetterDescriptor by ReflectProperties.lazySoft { // TODO: default getter created this way won't have any source information property.descriptor.getter ?: DescriptorFactory.createDefaultGetter(property.descriptor, Annotations.EMPTY) @@ -76,6 +76,8 @@ internal interface KMutablePropertyImpl : KMutableProperty, KPropertyImpl< override val name: String get() = "" + override val container: KDeclarationContainerImpl get() = property.container + override val descriptor: PropertySetterDescriptor by ReflectProperties.lazySoft { // TODO: default setter created this way won't have any source information property.descriptor.setter ?: DescriptorFactory.createDefaultSetter(property.descriptor, Annotations.EMPTY)