Package kotlin.jvm.internal
Class AdaptedFunctionReference
java.lang.Object
kotlin.jvm.internal.AdaptedFunctionReference
- All Implemented Interfaces:
Serializable,kotlin.Function,kotlin.jvm.internal.FunctionBase
@SinceKotlin(version="1.4")
public class AdaptedFunctionReference
extends Object
implements kotlin.jvm.internal.FunctionBase, Serializable
Superclass for instances of adapted function references, i.e. references where expected function type differs
from the target function signature:
fun target(s: String? = ""): String = s!!
fun use(f: () -> Unit) {}
use(::target) // adapted function reference (default argument conversion + coercion to Unit)
It doesn't inherit from FunctionReference because such references don't support reflection yet.
Once this changes in the future, the JVM codegen may simply use FunctionReferenceImpl
for adapted function references instead of this class.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAdaptedFunctionReference(int arity, Class owner, String name, String signature, int flags) AdaptedFunctionReference(int arity, Object receiver, Class owner, String name, String signature, int flags) -
Method Summary
-
Field Details
-
receiver
-
-
Constructor Details
-
AdaptedFunctionReference
-
AdaptedFunctionReference
-
-
Method Details
-
getArity
public int getArity()- Specified by:
getArityin interfacekotlin.jvm.internal.FunctionBase
-
getOwner
public kotlin.reflect.KDeclarationContainer getOwner() -
equals
-
hashCode
public int hashCode() -
toString
-