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 Details

    • receiver

      protected final Object receiver
  • Constructor Details

    • AdaptedFunctionReference

      public AdaptedFunctionReference(int arity, Class owner, String name, String signature, int flags)
    • AdaptedFunctionReference

      public AdaptedFunctionReference(int arity, Object receiver, Class owner, String name, String signature, int flags)
  • Method Details

    • getArity

      public int getArity()
      Specified by:
      getArity in interface kotlin.jvm.internal.FunctionBase
    • getOwner

      public kotlin.reflect.KDeclarationContainer getOwner()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object