Minor, make KCallableImpl a class

This will allow to cache stuff common to all callables in KCallableImpl
This commit is contained in:
Alexander Udalov
2016-09-07 16:13:41 +03:00
parent 4d7d70db19
commit 80db0e4b71
3 changed files with 8 additions and 8 deletions
@@ -24,14 +24,14 @@ import java.util.*
import kotlin.reflect.* import kotlin.reflect.*
import kotlin.reflect.jvm.javaType import kotlin.reflect.jvm.javaType
internal interface KCallableImpl<out R> : KCallable<R>, KAnnotatedElementImpl { internal abstract class KCallableImpl<out R> : KCallable<R>, KAnnotatedElementImpl {
val descriptor: CallableMemberDescriptor 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 override val annotated: Annotated get() = descriptor
@@ -33,7 +33,7 @@ internal class KFunctionImpl private constructor(
name: String, name: String,
private val signature: String, private val signature: String,
descriptorInitialValue: FunctionDescriptor? descriptorInitialValue: FunctionDescriptor?
) : KFunction<Any?>, KCallableImpl<Any?>, FunctionImpl, FunctionWithAllInvokes { ) : KCallableImpl<Any?>(), KFunction<Any?>, FunctionImpl, FunctionWithAllInvokes {
constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this(container, name, signature, null) constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this(container, name, signature, null)
constructor(container: KDeclarationContainerImpl, descriptor: FunctionDescriptor) : this( constructor(container: KDeclarationContainerImpl, descriptor: FunctionDescriptor) : this(
@@ -36,7 +36,7 @@ internal abstract class KPropertyImpl<out R> private constructor(
override val name: String, override val name: String,
val signature: String, val signature: String,
descriptorInitialValue: PropertyDescriptor? descriptorInitialValue: PropertyDescriptor?
) : KProperty<R>, KCallableImpl<R> { ) : KCallableImpl<R>(), KProperty<R> {
constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this( constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this(
container, name, signature, null container, name, signature, null
) )
@@ -105,7 +105,7 @@ internal abstract class KPropertyImpl<out R> private constructor(
ReflectionObjectRenderer.renderProperty(descriptor) ReflectionObjectRenderer.renderProperty(descriptor)
abstract class Accessor<out PropertyType, out ReturnType> : abstract class Accessor<out PropertyType, out ReturnType> :
KCallableImpl<ReturnType>, KProperty.Accessor<PropertyType>, KFunction<ReturnType> { KCallableImpl<ReturnType>(), KProperty.Accessor<PropertyType>, KFunction<ReturnType> {
abstract override val property: KPropertyImpl<PropertyType> abstract override val property: KPropertyImpl<PropertyType>
abstract override val descriptor: PropertyAccessorDescriptor abstract override val descriptor: PropertyAccessorDescriptor