Package kotlin.jvm.internal
Class AdaptedFunctionReference
- java.lang.Object
-
- kotlin.jvm.internal.AdaptedFunctionReference
-
- All Implemented Interfaces:
java.io.Serializable
,kotlin.Function
,kotlin.jvm.internal.FunctionBase
@SinceKotlin(version="1.4") public class AdaptedFunctionReference extends java.lang.Object implements kotlin.jvm.internal.FunctionBase, java.io.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 fromFunctionReference
because such references don't support reflection yet. Once this changes in the future, the JVM codegen may simply useFunctionReferenceImpl
for adapted function references instead of this class.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
receiver
-
Constructor Summary
Constructors Constructor Description AdaptedFunctionReference(int arity, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)
AdaptedFunctionReference(int arity, java.lang.Object receiver, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
getArity()
kotlin.reflect.KDeclarationContainer
getOwner()
int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
AdaptedFunctionReference
public AdaptedFunctionReference(int arity, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)
-
AdaptedFunctionReference
public AdaptedFunctionReference(int arity, java.lang.Object receiver, java.lang.Class owner, java.lang.String name, java.lang.String signature, int flags)
-
-
Method Detail
-
getArity
public int getArity()
- Specified by:
getArity
in interfacekotlin.jvm.internal.FunctionBase
-
getOwner
public kotlin.reflect.KDeclarationContainer getOwner()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-