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.
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| private final boolean | |
| private final String | |
| private final Class | |
| protected final Object | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | AdaptedFunctionReference(int arity, Object receiver, Class<T> owner, String name, String signature, int flags)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public int | |
| public kotlin. | |
| public int | |
| public String |
| arity | back to summary |
|---|---|
| private final int arity | |
| flags | back to summary |
|---|---|
| private final int flags | |
| isTopLevel | back to summary |
|---|---|
| private final boolean isTopLevel | |
| name | back to summary |
|---|---|
| private final String name | |
| owner | back to summary |
|---|---|
| private final Class<T> owner | |
| receiver | back to summary |
|---|---|
| protected final Object receiver | |
| signature | back to summary |
|---|---|
| private final String signature | |
| AdaptedFunctionReference | back to summary |
|---|---|
| public AdaptedFunctionReference(int arity, Class<T> owner, String name, String signature, int flags) | |
| AdaptedFunctionReference | back to summary |
|---|---|
| public AdaptedFunctionReference(int arity, Object receiver, Class<T> owner, String name, String signature, int flags) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getArity | back to summary |
|---|---|
public int getArity()
| |
| getOwner | back to summary |
|---|---|
| public kotlin. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |