From 80db0e4b718072c9e10fc451d4d9f2a3ff6a6603 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 7 Sep 2016 16:13:41 +0300 Subject: [PATCH] Minor, make KCallableImpl a class This will allow to cache stuff common to all callables in KCallableImpl --- .../src/kotlin/reflect/jvm/internal/KCallableImpl.kt | 10 +++++----- .../src/kotlin/reflect/jvm/internal/KFunctionImpl.kt | 2 +- .../src/kotlin/reflect/jvm/internal/KPropertyImpl.kt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) 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 8a14a9679d6..bdd7bb165aa 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KCallableImpl.kt @@ -24,14 +24,14 @@ import java.util.* import kotlin.reflect.* import kotlin.reflect.jvm.javaType -internal interface KCallableImpl : KCallable, KAnnotatedElementImpl { - val descriptor: CallableMemberDescriptor +internal abstract class KCallableImpl : KCallable, KAnnotatedElementImpl { + abstract val descriptor: CallableMemberDescriptor - val caller: FunctionCaller<*> + abstract val caller: FunctionCaller<*> - val defaultCaller: FunctionCaller<*>? + abstract val defaultCaller: FunctionCaller<*>? - val container: KDeclarationContainerImpl + abstract val container: KDeclarationContainerImpl override val annotated: Annotated get() = descriptor 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 d1917dd649e..c2410ff1806 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KFunctionImpl.kt @@ -33,7 +33,7 @@ internal class KFunctionImpl private constructor( name: String, private val signature: String, descriptorInitialValue: FunctionDescriptor? -) : KFunction, KCallableImpl, FunctionImpl, FunctionWithAllInvokes { +) : KCallableImpl(), KFunction, FunctionImpl, FunctionWithAllInvokes { constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this(container, name, signature, null) constructor(container: KDeclarationContainerImpl, descriptor: FunctionDescriptor) : this( 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 dad6a6036a5..ed068d2d036 100644 --- a/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt +++ b/core/reflection.jvm/src/kotlin/reflect/jvm/internal/KPropertyImpl.kt @@ -36,7 +36,7 @@ internal abstract class KPropertyImpl private constructor( override val name: String, val signature: String, descriptorInitialValue: PropertyDescriptor? -) : KProperty, KCallableImpl { +) : KCallableImpl(), KProperty { constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this( container, name, signature, null ) @@ -105,7 +105,7 @@ internal abstract class KPropertyImpl private constructor( ReflectionObjectRenderer.renderProperty(descriptor) abstract class Accessor : - KCallableImpl, KProperty.Accessor, KFunction { + KCallableImpl(), KProperty.Accessor, KFunction { abstract override val property: KPropertyImpl abstract override val descriptor: PropertyAccessorDescriptor