Convert FunctionBase to Kotlin, add type parameter to Lambda
This will make it possible to avoid raw types when inheriting from both FunctionBase and Function<R>. This change adds a generic type parameter to FunctionBase and Lambda which is not source-breaking under our policy because both FunctionBase and Lambda are internal classes (located in package kotlin.jvm.internal)
This commit is contained in:
committed by
Ilya Gorbunov
parent
e35ebff4e1
commit
51979b9ffa
@@ -37,7 +37,7 @@ internal class KFunctionImpl private constructor(
|
||||
private val signature: String,
|
||||
descriptorInitialValue: FunctionDescriptor?,
|
||||
private val boundReceiver: Any? = CallableReference.NO_RECEIVER
|
||||
) : KCallableImpl<Any?>(), KFunction<Any?>, FunctionBase, FunctionWithAllInvokes {
|
||||
) : KCallableImpl<Any?>(), KFunction<Any?>, FunctionBase<Any?>, FunctionWithAllInvokes {
|
||||
constructor(container: KDeclarationContainerImpl, name: String, signature: String, boundReceiver: Any?)
|
||||
: this(container, name, signature, null, boundReceiver)
|
||||
|
||||
@@ -143,7 +143,7 @@ internal class KFunctionImpl private constructor(
|
||||
private fun createConstructorCaller(member: Constructor<*>) =
|
||||
if (isBound) FunctionCaller.BoundConstructor(member, boundReceiver) else FunctionCaller.Constructor(member)
|
||||
|
||||
override fun getArity() = caller.arity
|
||||
override val arity: Int get() = caller.arity
|
||||
|
||||
override val isInline: Boolean
|
||||
get() = descriptor.isInline
|
||||
|
||||
Reference in New Issue
Block a user