[K/N] Move fields from KFunctionImpl to functions
This commit is contained in:
@@ -9,10 +9,21 @@ import kotlin.reflect.KFunction
|
||||
import kotlin.reflect.KType
|
||||
|
||||
@FixmeReflection
|
||||
internal abstract class KFunctionImpl<out R>(
|
||||
override val name: String, val fqName: String, val receiver: Any?,
|
||||
val arity: Int, val flags: Int, override val returnType: KType
|
||||
): KFunction<R> {
|
||||
internal abstract class KFunctionImpl<out R>: KFunction<R> {
|
||||
final override val returnType get() = computeReturnType()
|
||||
val flags get() = computeFlags()
|
||||
val arity get() = computeArity()
|
||||
val fqName get() = computeFqName()
|
||||
val receiver get() = computeReceiver()
|
||||
final override val name get() = computeName()
|
||||
|
||||
abstract fun computeReturnType() : KType
|
||||
abstract fun computeFlags() : Int
|
||||
abstract fun computeArity() : Int
|
||||
abstract fun computeFqName() : String
|
||||
abstract fun computeName() : String
|
||||
open fun computeReceiver(): Any? = null
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is KFunctionImpl<*>) return false
|
||||
return fqName == other.fqName && receiver == other.receiver
|
||||
|
||||
+1
-4
@@ -10,9 +10,6 @@ import kotlin.reflect.KFunction
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@FixmeReflection
|
||||
internal abstract class KSuspendFunctionImpl<out R>(
|
||||
name: String, fqName: String, receiver: Any?,
|
||||
arity: Int, flags: Int, returnType: KType
|
||||
): KFunctionImpl<R>(name, fqName, receiver, arity, flags, returnType) {
|
||||
internal abstract class KSuspendFunctionImpl<out R>: KFunctionImpl<R>() {
|
||||
override fun toString() = "suspend function $name"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user