Minor, make KCallableImpl a class
This will allow to cache stuff common to all callables in KCallableImpl
This commit is contained in:
@@ -24,14 +24,14 @@ import java.util.*
|
||||
import kotlin.reflect.*
|
||||
import kotlin.reflect.jvm.javaType
|
||||
|
||||
internal interface KCallableImpl<out R> : KCallable<R>, KAnnotatedElementImpl {
|
||||
val descriptor: CallableMemberDescriptor
|
||||
internal abstract class KCallableImpl<out R> : KCallable<R>, 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
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ internal class KFunctionImpl private constructor(
|
||||
name: String,
|
||||
private val signature: String,
|
||||
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, descriptor: FunctionDescriptor) : this(
|
||||
|
||||
@@ -36,7 +36,7 @@ internal abstract class KPropertyImpl<out R> private constructor(
|
||||
override val name: String,
|
||||
val signature: String,
|
||||
descriptorInitialValue: PropertyDescriptor?
|
||||
) : KProperty<R>, KCallableImpl<R> {
|
||||
) : KCallableImpl<R>(), KProperty<R> {
|
||||
constructor(container: KDeclarationContainerImpl, name: String, signature: String) : this(
|
||||
container, name, signature, null
|
||||
)
|
||||
@@ -105,7 +105,7 @@ internal abstract class KPropertyImpl<out R> private constructor(
|
||||
ReflectionObjectRenderer.renderProperty(descriptor)
|
||||
|
||||
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 descriptor: PropertyAccessorDescriptor
|
||||
|
||||
Reference in New Issue
Block a user